Instructions to use BAAI/AquilaChat-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BAAI/AquilaChat-7B with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("BAAI/AquilaChat-7B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
8b25c43
1
Parent(s): 9df3137
Update README.md
Browse files
README.md
CHANGED
|
@@ -67,6 +67,24 @@ with torch.no_grad():
|
|
| 67 |
|
| 68 |
out = tokenizer.decode(out.cpu().numpy().tolist())
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
print(out)
|
| 71 |
```
|
| 72 |
|
|
|
|
| 67 |
|
| 68 |
out = tokenizer.decode(out.cpu().numpy().tolist())
|
| 69 |
|
| 70 |
+
if "###" in out:
|
| 71 |
+
special_index = out.index("###")
|
| 72 |
+
out = out[: special_index]
|
| 73 |
+
|
| 74 |
+
if "[UNK]" in out:
|
| 75 |
+
special_index = out.index("[UNK]")
|
| 76 |
+
out = out[:special_index]
|
| 77 |
+
|
| 78 |
+
if "</s>" in out:
|
| 79 |
+
special_index = out.index("</s>")
|
| 80 |
+
out = out[: special_index]
|
| 81 |
+
|
| 82 |
+
if len(out) > 0 and out[0] == " ":
|
| 83 |
+
out = out[1:]
|
| 84 |
+
|
| 85 |
+
convert_tokens = convert_tokens[1:]
|
| 86 |
+
probs = probs[1:]
|
| 87 |
+
|
| 88 |
print(out)
|
| 89 |
```
|
| 90 |
|