user-agent commited on
Commit
db62c2e
1 Parent(s): 1576a7f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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.inputs.Image(type="pil"),
18
- outputs="text",
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()