Spaces:
Sleeping
Sleeping
victoriaono
commited on
Update app.py
Browse files
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 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
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()
|