wrapper228 commited on
Commit
6a8a7ab
1 Parent(s): d09a560

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -27,12 +27,14 @@ def predict_topic_by_title_and_abstract(text):
27
 
28
  tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")
29
 
30
- model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased", num_labels=8)
31
- model.load_state_dict(
32
- torch.load(
33
- "./trained_model"
34
- )
35
- )
 
 
36
 
37
  image = Image.open('logo.png')
38
 
 
27
 
28
  tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")
29
 
30
+ #model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased", num_labels=8)
31
+ #model.load_state_dict(
32
+ # torch.load(
33
+ # "./trained_model"
34
+ # )
35
+ #)
36
+ with open('trained_model.pickle', 'rb') as handle:
37
+ model = pickle.load(handle)
38
 
39
  image = Image.open('logo.png')
40