xxx1 commited on
Commit
05276fc
·
1 Parent(s): 52113b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  openai.api_key=os.getenv('openai_appkey')
2
  # doc is here https://platform.openai.com/docs/guides/chat/chat-vs-completions?utm_medium=email&_hsmi=248334739&utm_content=248334739&utm_source=hs_email
3
  def get_chatgpt(input_text):
@@ -31,11 +32,11 @@ with gr.Blocks(
31
  with gr.Column(scale=1):
32
  with gr.Row():
33
  with gr.Column(scale=1):
34
- chat_input = gr.Textbox(lines=1, label="VQA Quesiton Input")
35
  with gr.Row():
36
  clear_button = gr.Button(value="Clear", interactive=True)
37
  submit_button = gr.Button(
38
- value="VQA", interactive=True, variant="primary"
39
  )
40
 
41
  with gr.Column():
@@ -57,7 +58,7 @@ with gr.Blocks(
57
  [caption_output,gpt3_output_v1,caption_output_v1],
58
  )
59
 
60
- examples=[['bird.jpeg',"How many birds are there in the tree?"]]
61
  examples = gr.Examples(
62
  examples=examples,
63
  inputs=[image_input, chat_input],
 
1
+ import openai
2
  openai.api_key=os.getenv('openai_appkey')
3
  # doc is here https://platform.openai.com/docs/guides/chat/chat-vs-completions?utm_medium=email&_hsmi=248334739&utm_content=248334739&utm_source=hs_email
4
  def get_chatgpt(input_text):
 
32
  with gr.Column(scale=1):
33
  with gr.Row():
34
  with gr.Column(scale=1):
35
+ chat_input = gr.Textbox(lines=1, label="Quesiton Input")
36
  with gr.Row():
37
  clear_button = gr.Button(value="Clear", interactive=True)
38
  submit_button = gr.Button(
39
+ value="提问", interactive=True, variant="primary"
40
  )
41
 
42
  with gr.Column():
 
58
  [caption_output,gpt3_output_v1,caption_output_v1],
59
  )
60
 
61
+ examples=[["毛主席是什么时候出生的?"]]
62
  examples = gr.Examples(
63
  examples=examples,
64
  inputs=[image_input, chat_input],