Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,9 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import requests
|
| 3 |
import os
|
| 4 |
-
|
| 5 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 6 |
-
API_URL = "https://
|
| 7 |
-
|
| 8 |
SYSTEM_PROMPT = """Tu es l'assistant SAV officiel du Centre Chery Tunisie.
|
| 9 |
Tu réponds en français ou en arabe dialectal tunisien selon la langue du client.
|
| 10 |
Réponds uniquement aux questions liées aux véhicules Chery."""
|
|
@@ -48,5 +47,6 @@ def chat(message, history):
|
|
| 48 |
|
| 49 |
demo = gr.ChatInterface(fn=chat, title="🚗 Chery SAV Assistant")
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import requests
|
| 3 |
import os
|
| 4 |
+
import uvicorn
|
| 5 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 6 |
+
API_URL = "https://api-inference.huggingface.co/models/dali4444444/chery-sav-chatbot"
|
|
|
|
| 7 |
SYSTEM_PROMPT = """Tu es l'assistant SAV officiel du Centre Chery Tunisie.
|
| 8 |
Tu réponds en français ou en arabe dialectal tunisien selon la langue du client.
|
| 9 |
Réponds uniquement aux questions liées aux véhicules Chery."""
|
|
|
|
| 47 |
|
| 48 |
demo = gr.ChatInterface(fn=chat, title="🚗 Chery SAV Assistant")
|
| 49 |
|
| 50 |
+
if __name__ == "__main__":
|
| 51 |
+
port = int(os.environ.get("PORT", 7860))
|
| 52 |
+
uvicorn.run(app, host="0.0.0.0", port=port)
|