Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import requests
|
| 3 |
import os
|
| 4 |
-
|
| 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.
|
|
@@ -17,7 +17,6 @@ def chat(message, history):
|
|
| 17 |
prompt += f"{message} [/INST]"
|
| 18 |
|
| 19 |
headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
| 20 |
-
|
| 21 |
payload = {
|
| 22 |
"inputs": prompt,
|
| 23 |
"parameters": {
|
|
@@ -49,4 +48,4 @@ demo = gr.ChatInterface(fn=chat, title="🚗 Chery SAV Assistant")
|
|
| 49 |
|
| 50 |
if __name__ == "__main__":
|
| 51 |
port = int(os.environ.get("PORT", 7860))
|
| 52 |
-
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import requests
|
| 3 |
import os
|
| 4 |
+
|
| 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.
|
|
|
|
| 17 |
prompt += f"{message} [/INST]"
|
| 18 |
|
| 19 |
headers = {"Authorization": f"Bearer {HF_TOKEN}"}
|
|
|
|
| 20 |
payload = {
|
| 21 |
"inputs": prompt,
|
| 22 |
"parameters": {
|
|
|
|
| 48 |
|
| 49 |
if __name__ == "__main__":
|
| 50 |
port = int(os.environ.get("PORT", 7860))
|
| 51 |
+
demo.launch(server_name="0.0.0.0", server_port=port) # ✅ use demo.launch(), not uvicorn
|