Translation
Transformers
PyTorch
Safetensors
llama
text-generation
Eval Results (legacy)
text-generation-inference
Instructions to use Unbabel/TowerBase-7B-v0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Unbabel/TowerBase-7B-v0.1 with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="Unbabel/TowerBase-7B-v0.1")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Unbabel/TowerBase-7B-v0.1") model = AutoModelForCausalLM.from_pretrained("Unbabel/TowerBase-7B-v0.1") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -43,7 +43,24 @@ The model is not guaranteed to perform well for languages other than the 10 lang
|
|
| 43 |
|
| 44 |
## Bias, Risks, and Limitations
|
| 45 |
|
| 46 |
-
TowerBase-v0.1 has not been aligned to human preferences, so the model may generate problematic outputs (e.g., hallucinations, harmful content, or false statements).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
### Training Data
|
| 49 |
|
|
|
|
| 43 |
|
| 44 |
## Bias, Risks, and Limitations
|
| 45 |
|
| 46 |
+
TowerBase-v0.1 has not been aligned to human preferences, so the model may generate problematic outputs (e.g., hallucinations, harmful content, or false statements).
|
| 47 |
+
|
| 48 |
+
## Run the model
|
| 49 |
+
|
| 50 |
+
```python
|
| 51 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 52 |
+
|
| 53 |
+
model_id = "Unbabel/TowerBase-7B-v0.1"
|
| 54 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 55 |
+
|
| 56 |
+
model = AutoModelForCausalLM.from_pretrained(model_id)
|
| 57 |
+
|
| 58 |
+
text = "English: My name is TowerBase.\nPortuguese:"
|
| 59 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 60 |
+
|
| 61 |
+
outputs = model.generate(**inputs, max_new_tokens=20)
|
| 62 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 63 |
+
```
|
| 64 |
|
| 65 |
### Training Data
|
| 66 |
|