File size: 334 Bytes
4b898da df9435b 4b898da df9435b 64534ba df9435b acf182b df9435b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
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 = pipeline('text-generation', model='gpt2')
if btn:
res = llm(text)
result.success(res[0]["generated_text"].strip()) |