Pneptune commited on
Commit
eef0acc
·
1 Parent(s): a2759a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -7
app.py CHANGED
@@ -1,9 +1,18 @@
1
- import streamlit as st
2
- from transformers import pipeline
3
 
4
- pipe = pipeline('sentimate - analysis')
5
- text = st.text.area('enter some text')
 
 
 
6
 
7
- if text:
8
- out = pipe(test)
9
- st.json(out)
 
 
 
 
 
 
 
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}."
6
+ for i in range(min(len(response), int(tokens))):
7
+ time.sleep(0.05)
8
+ yield response[: i+1]
9
 
10
+ demo = gr.ChatInterface(echo,
11
+ additional_inputs=[
12
+ gr.Textbox("You are helpful AI.", label="System Prompt"),
13
+ gr.Slider(10, 100)
14
+ ]
15
+ )
16
+
17
+ if __name__ == "__main__":
18
+ demo.queue().launch()