Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -109,8 +109,6 @@ with gr.Blocks() as demo:
|
|
| 109 |
if assistant_msg is not None:
|
| 110 |
chat_data.append({"role": "assistant", "content": assistant_msg})
|
| 111 |
|
| 112 |
-
print(chat_data
|
| 113 |
-
)
|
| 114 |
message = tokenizer.apply_chat_template(chat_data, tokenize=False)
|
| 115 |
message = message[3:] # remove SOT token
|
| 116 |
|
|
@@ -130,7 +128,7 @@ with gr.Blocks() as demo:
|
|
| 130 |
"frequency_penalty": FREQUENCY_PENALTY,
|
| 131 |
}
|
| 132 |
|
| 133 |
-
outputs = requests.post(
|
| 134 |
return outputs
|
| 135 |
|
| 136 |
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
|
|
|
| 109 |
if assistant_msg is not None:
|
| 110 |
chat_data.append({"role": "assistant", "content": assistant_msg})
|
| 111 |
|
|
|
|
|
|
|
| 112 |
message = tokenizer.apply_chat_template(chat_data, tokenize=False)
|
| 113 |
message = message[3:] # remove SOT token
|
| 114 |
|
|
|
|
| 128 |
"frequency_penalty": FREQUENCY_PENALTY,
|
| 129 |
}
|
| 130 |
|
| 131 |
+
outputs = requests.post(API_URL, headers=headers, data=json.dumps(data)).json()
|
| 132 |
return outputs
|
| 133 |
|
| 134 |
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|