Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -39,7 +39,7 @@ def gpt3_short(question,vqa_answer,caption):
|
|
39 |
prompt="prompt: This is a picture of Caption: "+caption+". Question: "+question+" VQA model predicts:"+"A: "+vqa_answer[0]+"socre:"+str(vqa_score[0])+\
|
40 |
" B: "+vqa_answer[1]+" score:"+str(vqa_score[1])+" C: "+vqa_answer[2]+" score:"+str(vqa_score[2])+\
|
41 |
" D: "+vqa_answer[3]+'score:'+str(vqa_score[3])+\
|
42 |
-
". Choose A if it is not in conflict with the description of the picture and A's score is bigger than 0.8; otherwise choose the B, C or D based on the description."
|
43 |
|
44 |
# prompt=caption+"\n"+question+"\n"+vqa_answer+"\n Tell me the right answer."
|
45 |
response = openai.Completion.create(
|
@@ -184,11 +184,11 @@ with gr.Blocks(
|
|
184 |
[gpt3_output_v1],
|
185 |
)
|
186 |
'''
|
187 |
-
examples=[['bird.jpeg',"How many birds are there in the tree?","
|
188 |
-
['qa9.jpg',"What type of vehicle is being pulled by the horses ?",'
|
189 |
-
['upload4.jpg',"What is this old man doing?","
|
190 |
examples = gr.Examples(
|
191 |
-
examples=examples,inputs=[image_input, chat_input,caption_output_v1,
|
192 |
)
|
193 |
|
194 |
iface.queue(concurrency_count=1, api_open=False, max_size=10)
|
|
|
39 |
prompt="prompt: This is a picture of Caption: "+caption+". Question: "+question+" VQA model predicts:"+"A: "+vqa_answer[0]+"socre:"+str(vqa_score[0])+\
|
40 |
" B: "+vqa_answer[1]+" score:"+str(vqa_score[1])+" C: "+vqa_answer[2]+" score:"+str(vqa_score[2])+\
|
41 |
" D: "+vqa_answer[3]+'score:'+str(vqa_score[3])+\
|
42 |
+
". Choose A if it is not in conflict with the description of the picture and A's score is bigger than 0.8; otherwise choose the B, C or D based on the description. Answer with A or B or C or D."
|
43 |
|
44 |
# prompt=caption+"\n"+question+"\n"+vqa_answer+"\n Tell me the right answer."
|
45 |
response = openai.Completion.create(
|
|
|
184 |
[gpt3_output_v1],
|
185 |
)
|
186 |
'''
|
187 |
+
examples=[['bird.jpeg',"How many birds are there in the tree?","2","2","2"],
|
188 |
+
['qa9.jpg',"What type of vehicle is being pulled by the horses ?",'carriage','carriage','Sled'],
|
189 |
+
['upload4.jpg',"What is this old man doing?","fishing.","fishing","Fishing"]]
|
190 |
examples = gr.Examples(
|
191 |
+
examples=examples,inputs=[image_input, chat_input,caption_output,caption_output_v1,gpt3_output_v1],
|
192 |
)
|
193 |
|
194 |
iface.queue(concurrency_count=1, api_open=False, max_size=10)
|