victoriaono commited on
Commit
f1ed043
·
verified ·
1 Parent(s): 1e79d7a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import gradio as gr
 
2
 
3
  def echo(message, history, system_prompt, tokens):
4
  response = f"System prompt: {system_prompt}\n Message: {message}."
@@ -7,12 +8,12 @@ def echo(message, history, system_prompt, tokens):
7
  yield response[: i + 1]
8
 
9
 
10
- demo = gr.ChatInterface(
11
- echo,
12
- additional_inputs=[
13
- gr.Textbox("You are helpful AI.", label="System Prompt"),
14
- gr.Slider(10, 100),
15
- ],
16
- )
17
 
18
  demo.launch()
 
1
  import gradio as gr
2
+ import time
3
 
4
  def echo(message, history, system_prompt, tokens):
5
  response = f"System prompt: {system_prompt}\n Message: {message}."
 
8
  yield response[: i + 1]
9
 
10
 
11
+ with gr.Blocks() as demo:
12
+ system_prompt = gr.Textbox("You are helpful AI.", label="System Prompt")
13
+ slider = gr.Slider(10, 100, render=False)
14
+
15
+ gr.ChatInterface(
16
+ echo, additional_inputs=[system_prompt, slider]
17
+ )
18
 
19
  demo.launch()