Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
@@ -118,12 +118,14 @@ async def process_item(prompts: List[str] = Form(...)):
|
|
118 |
raise HTTPException(status_code=400, detail="No images uploaded.")
|
119 |
|
120 |
global chatbot
|
|
|
121 |
for prompt in prompts:
|
122 |
chat.ask(prompt, chat_state)
|
123 |
chatbot = chatbot + [[prompt, None]]
|
124 |
llm_message = chat.answer(conv=chat_state, img_list=img_list, max_new_tokens=300, num_beams=1, temperature=1, max_length=2000)[0]
|
125 |
chatbot[-1][1] = llm_message
|
126 |
-
|
|
|
127 |
|
128 |
|
129 |
@app.post("/reset/")
|
|
|
118 |
raise HTTPException(status_code=400, detail="No images uploaded.")
|
119 |
|
120 |
global chatbot
|
121 |
+
responses = []
|
122 |
for prompt in prompts:
|
123 |
chat.ask(prompt, chat_state)
|
124 |
chatbot = chatbot + [[prompt, None]]
|
125 |
llm_message = chat.answer(conv=chat_state, img_list=img_list, max_new_tokens=300, num_beams=1, temperature=1, max_length=2000)[0]
|
126 |
chatbot[-1][1] = llm_message
|
127 |
+
responses.append([prompt, llm_message])
|
128 |
+
return responses
|
129 |
|
130 |
|
131 |
@app.post("/reset/")
|