Spaces:
Runtime error
Runtime error
import streamlit as st | |
from transformers import pipeline | |
def get_model(model): | |
return pipeline("fill-mask", model=model) | |
text = st.text_input("Enter a text for auto completion...") | |
history_keyword_text = st.text_input("Users's history keyword split with ','") | |
model = st.selectbox("choose a model", ["roberta-base", "bert-base-uncased", "gpt2", "t5"]) | |
if text: | |
data_load_state = st.text('Loading...') | |
nlp = get_model(model) | |
result = nlp(text+nlp.tokenizer.mask_token) | |
data_load_state.text('Loading data...done!') | |
# for c in result: | |
# del c["token"] | |
st.table(result) |