Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ model_tkn = AutoTokenizer.from_pretrained(model_name)
|
|
10 |
|
11 |
def translate(text):
|
12 |
inputs = model_tkn(text, return_tensors="pt")
|
13 |
-
|
14 |
response = model_tkn.decode(trans_output[0], skip_special_tokens=True)
|
15 |
#response = opus_translator(text)
|
16 |
return response
|
|
|
10 |
|
11 |
def translate(text):
|
12 |
inputs = model_tkn(text, return_tensors="pt")
|
13 |
+
trans_output = model.generate(**inputs) #"generate": This method includes the logic for autoregressive generation
|
14 |
response = model_tkn.decode(trans_output[0], skip_special_tokens=True)
|
15 |
#response = opus_translator(text)
|
16 |
return response
|