chage the order of text and image components
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ import os
|
|
| 14 |
|
| 15 |
openai_api_key = os.environ.get('openai_api_key')
|
| 16 |
|
| 17 |
-
def ask_image(image,
|
| 18 |
base64_image = encode_image(image)
|
| 19 |
messages=[
|
| 20 |
{
|
|
@@ -79,7 +79,7 @@ description = "Ask anything about your Image"
|
|
| 79 |
|
| 80 |
demo = gr.Interface(
|
| 81 |
fn=ask_image,
|
| 82 |
-
inputs=[gr.Image(label='',type='filepath')
|
| 83 |
outputs=[gr.Textbox(label="Answer",lines=3)],
|
| 84 |
title = title,
|
| 85 |
description = description
|
|
|
|
| 14 |
|
| 15 |
openai_api_key = os.environ.get('openai_api_key')
|
| 16 |
|
| 17 |
+
def ask_image(text,image,api_token=openai_api_key):
|
| 18 |
base64_image = encode_image(image)
|
| 19 |
messages=[
|
| 20 |
{
|
|
|
|
| 79 |
|
| 80 |
demo = gr.Interface(
|
| 81 |
fn=ask_image,
|
| 82 |
+
inputs=[gr.Text(label="Question"),gr.Image(label='',type='filepath')],
|
| 83 |
outputs=[gr.Textbox(label="Answer",lines=3)],
|
| 84 |
title = title,
|
| 85 |
description = description
|