File size: 346 Bytes
4b898da
df9435b
4b898da
 
 
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 = pipleline('text-generation', model='gpt2')

if btn:
    res = llm.generation(text)
    result.success(res[0]["generated_text"].strip())