Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ tgt_lang="zu"
|
|
8 |
|
9 |
# tokenizer = AutoTokenizer.from_pretrained(model_path, src_lang=src_lang)
|
10 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
11 |
-
model = AutoModelForSeq2SeqLM.from_pretrained(model_path)#, load_in_4bit=True, device_map="auto")
|
12 |
|
13 |
def translate(text, num_beams=4, num_return_sequences=4):
|
14 |
inputs = tokenizer(text, return_tensors="pt")
|
|
|
8 |
|
9 |
# tokenizer = AutoTokenizer.from_pretrained(model_path, src_lang=src_lang)
|
10 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
11 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(model_path, use_safetensors=True)#, load_in_4bit=True, device_map="auto")
|
12 |
|
13 |
def translate(text, num_beams=4, num_return_sequences=4):
|
14 |
inputs = tokenizer(text, return_tensors="pt")
|