Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ def caption(input_image):
|
|
23 |
inputs["num_beams"] = 4
|
24 |
inputs['num_return_sequences'] =4
|
25 |
out = cap_model.generate(**inputs)
|
26 |
-
return "\n".join(processor.decode(out
|
27 |
import openai
|
28 |
openai.api_key="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"
|
29 |
def gpt3(question,vqa_answer,caption):
|
@@ -69,18 +69,18 @@ with gr.Blocks(
|
|
69 |
with gr.Row():
|
70 |
clear_button = gr.Button(value="Clear", interactive=True)
|
71 |
submit_button = gr.Button(
|
72 |
-
value="
|
73 |
)
|
74 |
cap_submit_button = gr.Button(
|
75 |
-
value="
|
76 |
)
|
77 |
gpt3_submit_button = gr.Button(
|
78 |
-
value="
|
79 |
)
|
80 |
with gr.Column():
|
81 |
caption_output = gr.Textbox(lines=0, label="VQA Output(模型答案输出)")
|
82 |
caption_output_v1 = gr.Textbox(lines=0, label="Caption Output(模型caption输出)")
|
83 |
-
gpt3_output_v1 = gr.Textbox(lines=0, label="GPT3 Output(
|
84 |
|
85 |
image_input.change(
|
86 |
lambda: ("", "", []),
|
|
|
23 |
inputs["num_beams"] = 4
|
24 |
inputs['num_return_sequences'] =4
|
25 |
out = cap_model.generate(**inputs)
|
26 |
+
return "\n".join(processor.decode(out, skip_special_tokens=True))
|
27 |
import openai
|
28 |
openai.api_key="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"
|
29 |
def gpt3(question,vqa_answer,caption):
|
|
|
69 |
with gr.Row():
|
70 |
clear_button = gr.Button(value="Clear", interactive=True)
|
71 |
submit_button = gr.Button(
|
72 |
+
value="Submit_VQA", interactive=True, variant="primary"
|
73 |
)
|
74 |
cap_submit_button = gr.Button(
|
75 |
+
value="Submit_CAP", interactive=True, variant="primary"
|
76 |
)
|
77 |
gpt3_submit_button = gr.Button(
|
78 |
+
value="Submit_GPT3", interactive=True, variant="primary"
|
79 |
)
|
80 |
with gr.Column():
|
81 |
caption_output = gr.Textbox(lines=0, label="VQA Output(模型答案输出)")
|
82 |
caption_output_v1 = gr.Textbox(lines=0, label="Caption Output(模型caption输出)")
|
83 |
+
gpt3_output_v1 = gr.Textbox(lines=0, label="GPT3 Output(GPT3输出)")
|
84 |
|
85 |
image_input.change(
|
86 |
lambda: ("", "", []),
|