Spaces:
Runtime error
Runtime error
Commit ·
d8afe0b
1
Parent(s): 2ce0e18
Update app.py
Browse files8 unmodified lines910111213141511 unmodified lines2728293031323334353637388 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 linestokenizer = 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)8 unmodified lines9101112131411 unmodified lines2627282930318 unmodified lineswith open('labels.pickle', 'rb') as handle:labels = pickle.load(handle)def predict_topic_by_title_and_abstract(text, model):tokens = tokenizer(text, return_tensors='pt', truncation=True)with torch.no_grad():11 unmodified linestokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")with open('trained_model.pickle', 'rb') as handle:model = pickle.load(handle)
app.py-7