Spaces:
Running
Running
Commit ·
0f60aab
1
Parent(s): e395751
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,10 @@ import os
|
|
| 7 |
load_dotenv()
|
| 8 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
| 11 |
API_URL = f"https://api-inference.huggingface.co/models/{model_name}"
|
| 12 |
headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
| 13 |
|
|
@@ -31,7 +34,7 @@ translator = gr.Interface(
|
|
| 31 |
fn=translate,
|
| 32 |
inputs=[gr.Textbox(label="Input Text", placeholder="Input Text To Be Translated")],
|
| 33 |
outputs=gr.Textbox(label="Translation"),
|
| 34 |
-
title="
|
| 35 |
)
|
| 36 |
|
| 37 |
translator.launch()
|
|
|
|
| 7 |
load_dotenv()
|
| 8 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 9 |
|
| 10 |
+
# Debug: Print the HF_TOKEN to verify
|
| 11 |
+
print(f"Extracted HF_TOKEN: {HF_TOKEN}")
|
| 12 |
+
|
| 13 |
+
model_name = "Helsinki-NLP/opus-mt-en-nso"
|
| 14 |
API_URL = f"https://api-inference.huggingface.co/models/{model_name}"
|
| 15 |
headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
| 16 |
|
|
|
|
| 34 |
fn=translate,
|
| 35 |
inputs=[gr.Textbox(label="Input Text", placeholder="Input Text To Be Translated")],
|
| 36 |
outputs=gr.Textbox(label="Translation"),
|
| 37 |
+
title="TranslAcademia",
|
| 38 |
)
|
| 39 |
|
| 40 |
translator.launch()
|