eliwill commited on
Commit
bcba41d
·
1 Parent(s): eafa9b9

Import new tutorial

Browse files
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -1,16 +1,18 @@
1
- # This is the application file
2
-
3
  import gradio as gr
4
 
5
- def print_hello_audrey(name):
6
- return "Audrey says hello to: " + name
7
-
8
  with gr.Blocks() as demo:
9
- name = gr.Textbox(label="Name")
10
- output = gr.Textbox(label="Response")
11
- audrey_welcome_btn = gr.Button("Welcome button")
12
- audrey_welcome_btn.click(fn=print_hello_audrey, inputs=name, outputs=output)
13
-
 
 
 
 
 
14
  demo.launch()
15
-
16
 
 
 
 
1
  import gradio as gr
2
 
3
+ def welcome(name):
4
+ return f"Welcome to Gradio, {name}!"
5
+
6
  with gr.Blocks() as demo:
7
+ gr.Markdown(
8
+ """
9
+ # Krishnamurti Text Generator Program
10
+ Hello, and welcome to the *Krishamurti Text-Generation Program*
11
+ Please enter your question below.
12
+ """)
13
+ inp = gr.Textbox(placeholder="What is your name?")
14
+ out = gr.Textbox()
15
+ inp.change(welcome, inp, out)
16
+
17
  demo.launch()
 
18