Spaces:
Running
Running
SnJForever
commited on
Commit
•
73b6b42
1
Parent(s):
701024e
Update app.py
Browse files
app.py
CHANGED
@@ -86,7 +86,8 @@ def submit_message(type_select,user_token, prompt, prompt_template, temperature,
|
|
86 |
)
|
87 |
print("image result ",response)
|
88 |
image_url = response['data'][0]['url']
|
89 |
-
|
|
|
90 |
history.append({ "role": "image", "content": image_url })
|
91 |
|
92 |
state['total_tokens'] += 0
|
@@ -104,8 +105,8 @@ def submit_message(type_select,user_token, prompt, prompt_template, temperature,
|
|
104 |
print(1,chat_messages)
|
105 |
chat_messages=[]
|
106 |
for i in range(0, len(history)-1, 2):
|
107 |
-
print(history[i]
|
108 |
-
if(history[i]['role']=='image'):
|
109 |
chat_messages.append((history[i]['content'], (history[i+1]['content'],)))
|
110 |
else:
|
111 |
chat_messages.append((history[i]['content'], history[i+1]['content']))
|
|
|
86 |
)
|
87 |
print("image result ",response)
|
88 |
image_url = response['data'][0]['url']
|
89 |
+
|
90 |
+
history.append({ "role": "image", "content": prompt })
|
91 |
history.append({ "role": "image", "content": image_url })
|
92 |
|
93 |
state['total_tokens'] += 0
|
|
|
105 |
print(1,chat_messages)
|
106 |
chat_messages=[]
|
107 |
for i in range(0, len(history)-1, 2):
|
108 |
+
print(history[i])
|
109 |
+
if(history[i]['role'] == 'image'):
|
110 |
chat_messages.append((history[i]['content'], (history[i+1]['content'],)))
|
111 |
else:
|
112 |
chat_messages.append((history[i]['content'], history[i+1]['content']))
|