Vihang28 commited on
Commit
2303e9e
·
1 Parent(s): 1054e81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -36,22 +36,22 @@ def upload_img(image,api_key,img_ques):
36
  img_preview = response.json()
37
  return img_preview["choices"][0]["message"]["content"]
38
 
39
- title = """<h1 align="center">GPT-4 Preview</h1>"""
40
 
41
- with gr.Blocks() as demo:
42
- gr.Markdown(title)
43
 
44
- with gr.Row():
45
- with gr.Column():
46
- image_input = gr.Image(type="filepath", label="Upload Image")
47
- key_input = gr.Textbox(label="Enter API-key")
48
- upload_button = gr.Button(value="Upload & Start Chat", interactive=True, variant="primary")
49
- btn_clear = gr.ClearButton([image_input,key_input],[text])
50
 
51
- with gr.Column():
52
- text = gr.Textbox(label="Output")
53
- ques_input = gr.Textbox(label="Enter the question")
54
- ques_clear = gr.ClearButton([ques_input])
55
 
56
  upload_button.click(upload_img, inputs=[image_input,key_input,ques_input], outputs=text)
57
  btn_clear.add(text)
 
36
  img_preview = response.json()
37
  return img_preview["choices"][0]["message"]["content"]
38
 
39
+ title = """<h1 align="center">GPT-4 Image Preview</h1>"""
40
 
41
+ with gradio.Blocks() as demo:
42
+ gradio.Markdown(title)
43
 
44
+ with gradio.Row():
45
+ with gradio.Column():
46
+ image_input = gradio.Image(type="filepath", label="Upload Image")
47
+ key_input = gradio.Textbox(label="Enter API-key")
48
+ upload_button = gradio.Button(value="Upload & Start Chat", interactive=True, variant="primary")
49
+ btn_clear = gradio.ClearButton([image_input,key_input],[text])
50
 
51
+ with gradio.Column():
52
+ text = gradio.Textbox(label="Output")
53
+ ques_input = gradio.Textbox(label="Enter the question")
54
+ ques_clear = gradio.ClearButton([ques_input])
55
 
56
  upload_button.click(upload_img, inputs=[image_input,key_input,ques_input], outputs=text)
57
  btn_clear.add(text)