Spaces:
Runtime error
Runtime error
File size: 494 Bytes
6f1901f c54dd0d 6f1901f 00d5eee 7a4181f 00d5eee |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import gradio as gr
import requests
import io
from PIL import Image
def greet(name):
return "Hello " + name + "!!"
with gr.Blocks(theme=gr.themes.Glass()) as demo:
name = gr.Textbox(label="Name")
output = gr.Textbox(label="Output Box")
greet_btn = gr.Button("Greet")
greet_btn.click(fn=greet, inputs=name, outputs=output, api_name="greet")
demo = gr.Interface(
fn=greet,
inputs=gr.Textbox(lines=2, placeholder="Name Here..."),
outputs="text",
)
demo.launch() |