File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ def analyze_image(image_url, prompt):
97
97
98
98
# Extract and return the model's response
99
99
result = response .json ()
100
- return result ["choices" ][0 ]["message" ]["content" ]
100
+ return image , result ["choices" ][0 ]["message" ]["content" ]
101
101
102
102
except Exception as e :
103
103
return f"An error occurred: { str (e )} "
@@ -114,7 +114,7 @@ def analyze_image(image_url, prompt):
114
114
gr .Textbox (label = "Image URL" ),
115
115
gr .Textbox (label = "Prompt/Question" , elem_id = "prompt" , scale = 2 ),
116
116
],
117
- outputs = gr .Textbox (label = "Results" ),
117
+ outputs = [ gr .Image ( label = "Image" ), gr . Textbox (label = "Results" )] ,
118
118
title = settings .page_title ,
119
119
description = settings .page_description ,
120
120
examples = [[ex .image_url , ex .prompt ] for ex in settings .examples ],
You can’t perform that action at this time.
0 commit comments