doc / app.py
LaotHF's picture
Update app.py
df9435b verified
raw
history blame
346 Bytes
import streamlit as st
from transformers import pipeline
x = st.slider('Select a value')
st.write(x, 'squared is', x * x)
text = st.text_input('Please input')
btn = st.button('Send')
result = st.empty()
llm = pipleline('text-generation', model='gpt2')
if btn:
res = llm.generation(text)
result.success(res[0]["generated_text"].strip())