Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,13 +4,6 @@ from transformers import pipeline
|
|
| 4 |
# Load the translation model
|
| 5 |
translator = pipeline("translation_en_to_hi", model="Helsinki-NLP/opus-mt-en-hi")
|
| 6 |
|
| 7 |
-
# Define the translation function
|
| 8 |
-
#def translate_text(text):
|
| 9 |
-
#if not text:
|
| 10 |
-
#return "⚠️ Please provide some input text."
|
| 11 |
-
#result = translator(text)[0]["translation_text"]
|
| 12 |
-
#return result
|
| 13 |
-
|
| 14 |
def translate_text(text):
|
| 15 |
if not text:
|
| 16 |
return "⚠️ Please provide some input text."
|
|
|
|
| 4 |
# Load the translation model
|
| 5 |
translator = pipeline("translation_en_to_hi", model="Helsinki-NLP/opus-mt-en-hi")
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
def translate_text(text):
|
| 8 |
if not text:
|
| 9 |
return "⚠️ Please provide some input text."
|