Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -30,7 +30,7 @@ def write_elo_ratings(elo_ratings):
|
|
30 |
def format_chatml_prompt(state):
|
31 |
chatml_prompt = ""
|
32 |
for message in state["history"]:
|
33 |
-
chatml_prompt += "
|
34 |
return chatml_prompt+"Assistant:"
|
35 |
def get_bot_response(url, prompt,state):
|
36 |
chatml_prompt = format_chatml_prompt(state)
|
@@ -49,7 +49,7 @@ def get_bot_response(url, prompt,state):
|
|
49 |
"authorization": os.environ.get("RUNPOD_TOKEN")
|
50 |
}
|
51 |
response = requests.post(url, json=payload, headers=headers)
|
52 |
-
return response.json()['output'][0]['generated_text']
|
53 |
|
54 |
def chat_with_bots(user_input, state):
|
55 |
bot_names = list(chatbots.keys())
|
|
|
30 |
def format_chatml_prompt(state):
|
31 |
chatml_prompt = ""
|
32 |
for message in state["history"]:
|
33 |
+
chatml_prompt += "<|im_start|>"+message['role']+": "+ message['content']+"<|im_end|>\n"
|
34 |
return chatml_prompt+"Assistant:"
|
35 |
def get_bot_response(url, prompt,state):
|
36 |
chatml_prompt = format_chatml_prompt(state)
|
|
|
49 |
"authorization": os.environ.get("RUNPOD_TOKEN")
|
50 |
}
|
51 |
response = requests.post(url, json=payload, headers=headers)
|
52 |
+
return response.json()['output'][0]['generated_text']
|
53 |
|
54 |
def chat_with_bots(user_input, state):
|
55 |
bot_names = list(chatbots.keys())
|