LaotHF commited on
Commit
df9435b
·
verified ·
1 Parent(s): 4b898da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -1,4 +1,14 @@
1
  import streamlit as st
 
2
 
3
  x = st.slider('Select a value')
4
  st.write(x, 'squared is', x * x)
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
+ from transformers import pipeline
3
 
4
  x = st.slider('Select a value')
5
  st.write(x, 'squared is', x * x)
6
+ text = st.text_input('Please input')
7
+ btn = st.button('Send')
8
+ result = st.empty()
9
+
10
+ llm = pipleline('text-generation', model='gpt2')
11
+
12
+ if btn:
13
+ res = llm.generation(text)
14
+ result.success(res[0]["generated_text"].strip())