prateekbh commited on
Commit
29ba44d
·
verified ·
1 Parent(s): 8d22089

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -28,10 +28,9 @@ class StopOnTokens(StoppingCriteria):
28
  return False
29
 
30
  @torch.no_grad()
31
- def response(history, image):
32
- gr.Info('Starting...')
33
  stop = StopOnTokens()
34
- message = 'please describe the image as an ecommerce product made out of wood'
35
 
36
  messages = [{"role": "system", "content": "You are a helpful assistant."}]
37
 
@@ -85,12 +84,13 @@ with gr.Blocks(css=css) as demo:
85
  with gr.Column(elem_id="col-container"):
86
  gr.HTML(title)
87
  image = gr.Image(type="pil")
 
88
  chat = gr.Chatbot(show_label=False)
89
  submit = gr.Button(value="Upload", variant="primary")
90
 
91
  response_handler = (
92
  response,
93
- [chat, image],
94
  [submit]
95
  )
96
 
 
28
  return False
29
 
30
  @torch.no_grad()
31
+ def response(message, history, image):
32
+ gr.Info('Starting...' + message)
33
  stop = StopOnTokens()
 
34
 
35
  messages = [{"role": "system", "content": "You are a helpful assistant."}]
36
 
 
84
  with gr.Column(elem_id="col-container"):
85
  gr.HTML(title)
86
  image = gr.Image(type="pil")
87
+ message = gr.Textbox(interactive=True, show_label=False, container=False)
88
  chat = gr.Chatbot(show_label=False)
89
  submit = gr.Button(value="Upload", variant="primary")
90
 
91
  response_handler = (
92
  response,
93
+ [message, chat, image],
94
  [submit]
95
  )
96