Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -6,7 +6,7 @@ import uvicorn
|
|
| 6 |
|
| 7 |
app = FastAPI()
|
| 8 |
|
| 9 |
-
client = InferenceClient("mistralai/
|
| 10 |
|
| 11 |
class Item(BaseModel):
|
| 12 |
prompt: str
|
|
@@ -18,11 +18,11 @@ class Item(BaseModel):
|
|
| 18 |
repetition_penalty: float = 1.0
|
| 19 |
|
| 20 |
def format_prompt(message, history):
|
| 21 |
-
prompt = "<s>
|
| 22 |
for user_prompt, bot_response in history:
|
| 23 |
prompt += f"[INST] {user_prompt} [/INST]"
|
| 24 |
prompt += f" {bot_response} "
|
| 25 |
-
prompt += f"
|
| 26 |
return prompt
|
| 27 |
|
| 28 |
def formatting_func(example):
|
|
|
|
| 6 |
|
| 7 |
app = FastAPI()
|
| 8 |
|
| 9 |
+
client = InferenceClient("mistralai/Mistral-7B-Instruct-v0.2")
|
| 10 |
|
| 11 |
class Item(BaseModel):
|
| 12 |
prompt: str
|
|
|
|
| 18 |
repetition_penalty: float = 1.0
|
| 19 |
|
| 20 |
def format_prompt(message, history):
|
| 21 |
+
prompt = "<s>"
|
| 22 |
for user_prompt, bot_response in history:
|
| 23 |
prompt += f"[INST] {user_prompt} [/INST]"
|
| 24 |
prompt += f" {bot_response} "
|
| 25 |
+
prompt += f"</s>[INST] {message} [/INST]"
|
| 26 |
return prompt
|
| 27 |
|
| 28 |
def formatting_func(example):
|