saicharan1234 commited on
Commit
a1b8157
·
verified ·
1 Parent(s): e109072

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -1
main.py CHANGED
@@ -112,6 +112,7 @@ async def upload_img(
112
  return {"message": "image uploaded successfully."}
113
 
114
 
 
115
  @app.post("/process/")
116
  async def process_item(prompts: List[str] = Form(...)):
117
  if not img_list: # Check if img_list is empty or None
@@ -121,8 +122,9 @@ async def process_item(prompts: List[str] = Form(...)):
121
  responses = []
122
 
123
  for prompt in prompts:
 
124
  chat.ask(prompt, chat_state)
125
- chatbot = chatbot + [[prompt, None]]
126
  llm_message = chat.answer(conv=chat_state, img_list=img_list, max_new_tokens=300, num_beams=1, temperature=1, max_length=2000)[0]
127
  chatbot[-1][1] = llm_message
128
  responses.append({
 
112
  return {"message": "image uploaded successfully."}
113
 
114
 
115
+
116
  @app.post("/process/")
117
  async def process_item(prompts: List[str] = Form(...)):
118
  if not img_list: # Check if img_list is empty or None
 
122
  responses = []
123
 
124
  for prompt in prompts:
125
+ # Process each prompt individually
126
  chat.ask(prompt, chat_state)
127
+ chatbot.append([prompt, None])
128
  llm_message = chat.answer(conv=chat_state, img_list=img_list, max_new_tokens=300, num_beams=1, temperature=1, max_length=2000)[0]
129
  chatbot[-1][1] = llm_message
130
  responses.append({