Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -63,9 +63,9 @@ def create_instruct_demo():
|
|
63 |
with gr.Row():
|
64 |
with gr.Column():
|
65 |
scene_img = gr.Image(label='Scene', type='filepath')
|
66 |
-
object_list = gr.Textbox(
|
67 |
-
lines=2, label="Instruction")
|
68 |
instruction = gr.Textbox(
|
|
|
|
|
69 |
lines=5, label="Input")
|
70 |
max_len = gr.Slider(minimum=1, maximum=512,
|
71 |
value=128, label="Max length")
|
@@ -80,7 +80,7 @@ def create_instruct_demo():
|
|
80 |
with gr.Column():
|
81 |
outputs = gr.Textbox(lines=50, label="Output")
|
82 |
|
83 |
-
inputs = [scene_img,
|
84 |
|
85 |
# 接下来设定具体的example格式
|
86 |
examples_img_list = glob.glob("caption_demo/*.png")
|
@@ -89,7 +89,7 @@ def create_instruct_demo():
|
|
89 |
scene_name = os.path.basename(example_img_one).split(".")[0]
|
90 |
example_object_list = example_dict[scene_name]["input"]
|
91 |
example_instruction = example_dict[scene_name]["instruction"]
|
92 |
-
example_one = [example_img_one,
|
93 |
examples.append(example_one)
|
94 |
|
95 |
gr.Examples(
|
|
|
63 |
with gr.Row():
|
64 |
with gr.Column():
|
65 |
scene_img = gr.Image(label='Scene', type='filepath')
|
|
|
|
|
66 |
instruction = gr.Textbox(
|
67 |
+
lines=2, label="Instruction")
|
68 |
+
object_list = gr.Textbox(
|
69 |
lines=5, label="Input")
|
70 |
max_len = gr.Slider(minimum=1, maximum=512,
|
71 |
value=128, label="Max length")
|
|
|
80 |
with gr.Column():
|
81 |
outputs = gr.Textbox(lines=50, label="Output")
|
82 |
|
83 |
+
inputs = [scene_img, instruction, object_list, max_len, top_k, temp]
|
84 |
|
85 |
# 接下来设定具体的example格式
|
86 |
examples_img_list = glob.glob("caption_demo/*.png")
|
|
|
89 |
scene_name = os.path.basename(example_img_one).split(".")[0]
|
90 |
example_object_list = example_dict[scene_name]["input"]
|
91 |
example_instruction = example_dict[scene_name]["instruction"]
|
92 |
+
example_one = [example_img_one, example_instruction, example_object_list, 512, 0.8, 200]
|
93 |
examples.append(example_one)
|
94 |
|
95 |
gr.Examples(
|