Spaces:
Runtime error
Runtime error
Commit ·
d8afe0b
1
Parent(s): 2ce0e18
Update app.py
Browse files8 unmodified lines910111212131411 unmodified lines2627283031323334352930318 unmodified lineswith open('labels.pickle', 'rb') as handle: labels = pickle.load(handle)
@st.cachedef predict_topic_by_title_and_abstract(text, model): tokens = tokenizer(text, return_tensors='pt', truncation=True) with torch.no_grad():11 unmodified lines
tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")
#model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased", num_labels=8)#model.load_state_dict(# torch.load(# "./trained_model"# )#)with open('trained_model.pickle', 'rb') as handle: model = pickle.load(handle)
app.py-7