Spaces:
Runtime error
Runtime error
SnJForever
commited on
Commit
•
ebef73f
1
Parent(s):
0d66700
Update app.py
Browse files
app.py
CHANGED
@@ -74,11 +74,11 @@ def submit_message(type_select,user_token, prompt, prompt_template, temperature,
|
|
74 |
try:
|
75 |
if type_select=='TEXT':
|
76 |
text_history = [x for x in history if x['role'] != 'image' ]
|
77 |
-
|
78 |
completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=system_prompt + text_history[-context_length*2:] + [prompt_msg], temperature=temperature, max_tokens=max_tokens)
|
79 |
history.append(prompt_msg)
|
80 |
history.append(completion.choices[0].message.to_dict())
|
81 |
-
|
82 |
state['total_tokens'] += completion['usage']['total_tokens']
|
83 |
elif type_select=='IMAGE':
|
84 |
response = openai.Image.create(
|
|
|
74 |
try:
|
75 |
if type_select=='TEXT':
|
76 |
text_history = [x for x in history if x['role'] != 'image' ]
|
77 |
+
print(text_history)
|
78 |
completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=system_prompt + text_history[-context_length*2:] + [prompt_msg], temperature=temperature, max_tokens=max_tokens)
|
79 |
history.append(prompt_msg)
|
80 |
history.append(completion.choices[0].message.to_dict())
|
81 |
+
print(completion.choices[0].message.to_dict())
|
82 |
state['total_tokens'] += completion['usage']['total_tokens']
|
83 |
elif type_select=='IMAGE':
|
84 |
response = openai.Image.create(
|