Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -143,11 +143,6 @@ def smollm(model_name, sl, tl, input_text):
|
|
| 143 |
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 144 |
return response.split("Translation:")[-1].strip()
|
| 145 |
|
| 146 |
-
# Example usage
|
| 147 |
-
english_text = "The weather today is beautiful and perfect for a picnic."
|
| 148 |
-
spanish_translation = translate_text(english_text, "English", "Spanish")
|
| 149 |
-
print(f"Spanish: {spanish_translation}")
|
| 150 |
-
|
| 151 |
def flan(model_name, sl, tl, input_text):
|
| 152 |
tokenizer = T5Tokenizer.from_pretrained(model_name, legacy=False)
|
| 153 |
model = T5ForConditionalGeneration.from_pretrained(model_name)
|
|
|
|
| 143 |
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 144 |
return response.split("Translation:")[-1].strip()
|
| 145 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
def flan(model_name, sl, tl, input_text):
|
| 147 |
tokenizer = T5Tokenizer.from_pretrained(model_name, legacy=False)
|
| 148 |
model = T5ForConditionalGeneration.from_pretrained(model_name)
|