Spaces:
Sleeping
Sleeping
user-agent
commited on
Commit
•
db62c2e
1
Parent(s):
1576a7f
Update app.py
Browse files
app.py
CHANGED
@@ -11,14 +11,14 @@ def image_to_base64(image):
|
|
11 |
img_str = base64.b64encode(buffered.getvalue()).decode()
|
12 |
return img_str
|
13 |
|
14 |
-
# Define the Gradio interface
|
15 |
iface = gr.Interface(
|
16 |
fn=image_to_base64,
|
17 |
-
inputs=gr.
|
18 |
-
outputs=
|
19 |
title="Image to Base64 Encoder",
|
20 |
description="Upload an image and convert it to a Base64 encoded string."
|
21 |
)
|
22 |
|
23 |
# Launch the interface
|
24 |
-
iface.launch()
|
|
|
11 |
img_str = base64.b64encode(buffered.getvalue()).decode()
|
12 |
return img_str
|
13 |
|
14 |
+
# Define the Gradio interface using the updated syntax
|
15 |
iface = gr.Interface(
|
16 |
fn=image_to_base64,
|
17 |
+
inputs=gr.Image(type="pil"),
|
18 |
+
outputs=gr.Textbox(),
|
19 |
title="Image to Base64 Encoder",
|
20 |
description="Upload an image and convert it to a Base64 encoded string."
|
21 |
)
|
22 |
|
23 |
# Launch the interface
|
24 |
+
iface.launch()
|