Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -110,7 +110,7 @@ def get_completion(message,history):
|
|
110 |
history_openai_format.append({"role": "user", "content": human })
|
111 |
history_openai_format.append({"role": "assistant", "content":assistant})
|
112 |
history_openai_format.append({"role": "user", "content": content})
|
113 |
-
print(history_openai_format)
|
114 |
|
115 |
system_message = '''You are GPT-4o("o" for omni), OpenAI's new flagship model that can reason across audio, vision, and text in real time.
|
116 |
GPT-4o matches GPT-4 Turbo performance on text in English and code, with significant improvement on text in non-English languages, while also being much faster.
|
@@ -130,7 +130,7 @@ def get_completion(message,history):
|
|
130 |
|
131 |
init_message = [{"role": "system", "content": system_message}]
|
132 |
messages = init_message + history_openai_format[-5:], #system message + latest 2 round dialogues + user input
|
133 |
-
|
134 |
# request body
|
135 |
data = {
|
136 |
'model': 'gpt-4o', # we use gpt-4o here
|
@@ -143,7 +143,7 @@ def get_completion(message,history):
|
|
143 |
# get response
|
144 |
response = requests.post('https://burn.hair/v1/chat/completions', headers=headers, json=data)
|
145 |
response_data = response.json()
|
146 |
-
|
147 |
if 'error' in response_data:
|
148 |
response_content = response_data['error']['message']
|
149 |
else:
|
|
|
110 |
history_openai_format.append({"role": "user", "content": human })
|
111 |
history_openai_format.append({"role": "assistant", "content":assistant})
|
112 |
history_openai_format.append({"role": "user", "content": content})
|
113 |
+
# print(history_openai_format)
|
114 |
|
115 |
system_message = '''You are GPT-4o("o" for omni), OpenAI's new flagship model that can reason across audio, vision, and text in real time.
|
116 |
GPT-4o matches GPT-4 Turbo performance on text in English and code, with significant improvement on text in non-English languages, while also being much faster.
|
|
|
130 |
|
131 |
init_message = [{"role": "system", "content": system_message}]
|
132 |
messages = init_message + history_openai_format[-5:], #system message + latest 2 round dialogues + user input
|
133 |
+
print(messages)
|
134 |
# request body
|
135 |
data = {
|
136 |
'model': 'gpt-4o', # we use gpt-4o here
|
|
|
143 |
# get response
|
144 |
response = requests.post('https://burn.hair/v1/chat/completions', headers=headers, json=data)
|
145 |
response_data = response.json()
|
146 |
+
print(response_data)
|
147 |
if 'error' in response_data:
|
148 |
response_content = response_data['error']['message']
|
149 |
else:
|