Spaces:
Runtime error
Runtime error
Commit
·
ed80f94
1
Parent(s):
d7bc99f
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ def generate_prompt(instruction):
|
|
40 |
def generate(
|
41 |
ctx,
|
42 |
image_state,
|
43 |
-
token_count=
|
44 |
temperature=0.2,
|
45 |
top_p=0.3,
|
46 |
presencePenalty = 0.0,
|
@@ -92,6 +92,14 @@ def generate(
|
|
92 |
##########################################################################
|
93 |
cur_dir = os.path.dirname(os.path.abspath(__file__))
|
94 |
examples = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
[
|
96 |
f"{cur_dir}/examples_extreme_ironing.jpg",
|
97 |
"What is unusual about this image?",
|
@@ -141,13 +149,13 @@ with gr.Blocks(title=title) as demo:
|
|
141 |
with gr.Column():
|
142 |
image = gr.Image(type='pil', label="Image")
|
143 |
with gr.Column():
|
144 |
-
prompt = gr.Textbox(lines=
|
145 |
value="Render a clear and concise summary of the photo.")
|
146 |
with gr.Row():
|
147 |
submit = gr.Button("Submit", variant="primary")
|
148 |
clear = gr.Button("Clear", variant="secondary")
|
149 |
with gr.Column():
|
150 |
-
output = gr.Textbox(label="Output", lines=
|
151 |
data = gr.Dataset(components=[image, prompt], samples=examples, label="Examples", headers=["Image", "Prompt"])
|
152 |
submit.click(chatbot, [image, prompt], [output])
|
153 |
clear.click(lambda: None, [], [output])
|
|
|
40 |
def generate(
|
41 |
ctx,
|
42 |
image_state,
|
43 |
+
token_count=200,
|
44 |
temperature=0.2,
|
45 |
top_p=0.3,
|
46 |
presencePenalty = 0.0,
|
|
|
92 |
##########################################################################
|
93 |
cur_dir = os.path.dirname(os.path.abspath(__file__))
|
94 |
examples = [
|
95 |
+
[
|
96 |
+
f"{cur_dir}/examples_pizza.jpg",
|
97 |
+
"What are steps to cook it?"
|
98 |
+
]
|
99 |
+
[
|
100 |
+
f"{cur_dir}/examples_bluejay.jpg",
|
101 |
+
"what is the name of this bird?",
|
102 |
+
]
|
103 |
[
|
104 |
f"{cur_dir}/examples_extreme_ironing.jpg",
|
105 |
"What is unusual about this image?",
|
|
|
149 |
with gr.Column():
|
150 |
image = gr.Image(type='pil', label="Image")
|
151 |
with gr.Column():
|
152 |
+
prompt = gr.Textbox(lines=8, label="Prompt",
|
153 |
value="Render a clear and concise summary of the photo.")
|
154 |
with gr.Row():
|
155 |
submit = gr.Button("Submit", variant="primary")
|
156 |
clear = gr.Button("Clear", variant="secondary")
|
157 |
with gr.Column():
|
158 |
+
output = gr.Textbox(label="Output", lines=10)
|
159 |
data = gr.Dataset(components=[image, prompt], samples=examples, label="Examples", headers=["Image", "Prompt"])
|
160 |
submit.click(chatbot, [image, prompt], [output])
|
161 |
clear.click(lambda: None, [], [output])
|