Spaces:
Runtime error
Runtime error
BounharAbdelaziz
commited on
Commit
β’
8b6ba6f
1
Parent(s):
1e119e9
use latest model
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
import requests
|
3 |
import os
|
4 |
|
5 |
-
API_URL = "https://api-inference.huggingface.co/models/
|
6 |
HF_TOKEN = os.environ['HF_TOKEN']
|
7 |
headers = {"Authorization": "Bearer "+ HF_TOKEN}
|
8 |
|
@@ -13,7 +13,7 @@ def respond(english_text):
|
|
13 |
darija_translated_text = requests.post(API_URL, headers=headers, json=payload)
|
14 |
return darija_translated_text.json()[0]["generated_text"]
|
15 |
|
16 |
-
app = gr.Interface(fn=respond, inputs="text", outputs="text", title="Terjman-Large
|
17 |
|
18 |
if __name__ == "__main__":
|
19 |
app.launch()
|
|
|
2 |
import requests
|
3 |
import os
|
4 |
|
5 |
+
API_URL = "https://api-inference.huggingface.co/models/BounharAbdelaziz/Terjman-Large-v2"
|
6 |
HF_TOKEN = os.environ['HF_TOKEN']
|
7 |
headers = {"Authorization": "Bearer "+ HF_TOKEN}
|
8 |
|
|
|
13 |
darija_translated_text = requests.post(API_URL, headers=headers, json=payload)
|
14 |
return darija_translated_text.json()[0]["generated_text"]
|
15 |
|
16 |
+
app = gr.Interface(fn=respond, inputs="text", outputs="text", title="Terjman-Large π¨βπ»π₯°", description="Translate English text to Moroccan Darija using our Large model (240M) π€")
|
17 |
|
18 |
if __name__ == "__main__":
|
19 |
app.launch()
|