Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,18 @@ from threading import Thread
|
|
| 15 |
import subprocess
|
| 16 |
import collections.abc as collections
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
# --- Constants ---
|
| 19 |
MODEL_URL = "https://huggingface.co/models"
|
| 20 |
TASKS_FILE = "tasks.json"
|
|
|
|
| 15 |
import subprocess
|
| 16 |
import collections.abc as collections
|
| 17 |
|
| 18 |
+
client = InferenceClient(
|
| 19 |
+
"mistralai/Mixtral-8x7B-Instruct-v0.1"
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
def format_prompt(message, history):
|
| 23 |
+
prompt = "<s>"
|
| 24 |
+
for user_prompt, bot_response in history:
|
| 25 |
+
prompt += f"[INST] {user_prompt} [/INST]"
|
| 26 |
+
prompt += f" {bot_response}</s> "
|
| 27 |
+
prompt += f"[INST] {message} [/INST]"
|
| 28 |
+
return prompt
|
| 29 |
+
|
| 30 |
# --- Constants ---
|
| 31 |
MODEL_URL = "https://huggingface.co/models"
|
| 32 |
TASKS_FILE = "tasks.json"
|