dali4444444 commited on
Commit
38e0965
·
verified ·
1 Parent(s): 42f26d8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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://router.huggingface.co/hf-inference/models/mistralai/Mistral-7B-Instruct-v0.3"
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
- # 🔥 THIS LINE IS THE KEY
52
- demo.launch(server_name="0.0.0.0", server_port=7860)
 
 
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)