aminaj commited on
Commit
43f7558
·
verified ·
1 Parent(s): b6cb50a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -34,12 +34,14 @@ def llm_response(history, text, img):
34
  if not img:
35
  response = txt_model.generate_content(text)
36
  history += [(None, response.text)]
37
- return history
38
  else:
39
  img = PIL.Image.open(img)
40
  response = vis_model.generate_content([text, img])
41
  history += [(None, response.text)]
42
- return history
 
 
 
43
 
44
  # Interface Code
45
  with gr.Blocks(theme=gr.themes.Default()) as app:
@@ -61,7 +63,7 @@ with gr.Blocks(theme=gr.themes.Default()) as app:
61
  [chatbot, text_box, image_box],
62
  chatbot).then(llm_response,
63
  [chatbot, text_box, image_box],
64
- chatbot)
65
 
66
  app.queue()
67
  app.launch()
 
34
  if not img:
35
  response = txt_model.generate_content(text)
36
  history += [(None, response.text)]
 
37
  else:
38
  img = PIL.Image.open(img)
39
  response = vis_model.generate_content([text, img])
40
  history += [(None, response.text)]
41
+
42
+ text = ''
43
+ img = None
44
+ return history, text, img
45
 
46
  # Interface Code
47
  with gr.Blocks(theme=gr.themes.Default()) as app:
 
63
  [chatbot, text_box, image_box],
64
  chatbot).then(llm_response,
65
  [chatbot, text_box, image_box],
66
+ [chatbot, text_box, image_box])
67
 
68
  app.queue()
69
  app.launch()