Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
3 |
|
4 |
# Load tokenizer and model
|
5 |
tokenizer = AutoTokenizer.from_pretrained("Unbabel/TowerBase-13B-v0.1")
|
6 |
-
model = AutoModelForCausalLM.from_pretrained("Unbabel/TowerBase-13B-v0.1",
|
7 |
|
8 |
# Define translation function
|
9 |
def translate_text(source_lang, target_lang, text):
|
|
|
3 |
|
4 |
# Load tokenizer and model
|
5 |
tokenizer = AutoTokenizer.from_pretrained("Unbabel/TowerBase-13B-v0.1")
|
6 |
+
model = AutoModelForCausalLM.from_pretrained("Unbabel/TowerBase-13B-v0.1",device_map="auto", load_in_4bit=True)
|
7 |
|
8 |
# Define translation function
|
9 |
def translate_text(source_lang, target_lang, text):
|