Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ def get_openai_key():
|
|
| 6 |
|
| 7 |
def process_image(openai_api_key,image_src):
|
| 8 |
print(openai_api_key)
|
|
|
|
| 9 |
# Combine the outputs into a single HTML output
|
| 10 |
custom_output = f'''
|
| 11 |
<h2>Image->Text:</h2>
|
|
@@ -15,13 +16,10 @@ def process_image(openai_api_key,image_src):
|
|
| 15 |
openai_api_key = gr.Textbox(value=get_openai_key(),label="OpenAI API Key",type="password")
|
| 16 |
image_input = gr.inputs.Image(type='filepath', label="Input Image")
|
| 17 |
|
| 18 |
-
#os.environ["OPENAI_API_KEY"] = openai_api_key
|
| 19 |
-
|
| 20 |
title_with_logo = \
|
| 21 |
f'Understanding Image with Text'
|
| 22 |
|
| 23 |
-
extra_title = r'
|
| 24 |
-
r'[](https://huggingface.co/spaces/Awiny/Image2Paragraph?duplicate=true)' + '\n\n'
|
| 25 |
|
| 26 |
interface = gr.Interface(
|
| 27 |
fn=lambda openai_api_key,image, options: process_image(openai_api_key,image),
|
|
|
|
| 6 |
|
| 7 |
def process_image(openai_api_key,image_src):
|
| 8 |
print(openai_api_key)
|
| 9 |
+
print(image_src)
|
| 10 |
# Combine the outputs into a single HTML output
|
| 11 |
custom_output = f'''
|
| 12 |
<h2>Image->Text:</h2>
|
|
|
|
| 16 |
openai_api_key = gr.Textbox(value=get_openai_key(),label="OpenAI API Key",type="password")
|
| 17 |
image_input = gr.inputs.Image(type='filepath', label="Input Image")
|
| 18 |
|
|
|
|
|
|
|
| 19 |
title_with_logo = \
|
| 20 |
f'Understanding Image with Text'
|
| 21 |
|
| 22 |
+
extra_title = r'\n\n'
|
|
|
|
| 23 |
|
| 24 |
interface = gr.Interface(
|
| 25 |
fn=lambda openai_api_key,image, options: process_image(openai_api_key,image),
|