ml-playground / app.py
Sasidhar's picture
Update app.py
d2f7d16
raw
history blame
400 Bytes
import transformers
import streamlit as st
from transformers import AutoTokenizer, AutoModelWithLMHead
tokenizer = AutoTokenizer.from_pretrained("gpt2-large")
@st.cache
def load_model(model_name):
model = AutoModelWithLMHead.from_pretrained("gpt2-large")
return model
model = load_model("gpt2-large")
print(model.config)
x = st.slider('Select a value')
st.write(x, 'squared is', x * x)