Pendrokar commited on
Commit
d3c4b81
·
1 Parent(s): 320787e

load model with autoloader

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -10,9 +10,10 @@ import numpy as np
10
 
11
  from torchmoji.sentence_tokenizer import SentenceTokenizer
12
  from torchmoji.model_def import torchmoji_emojis
13
-
14
  model_name = "Uberduck/torchmoji"
15
- model_path = './' + model_name + "/pytorch_model.bin"
 
16
  vocab_path = './' + model_name + "/vocabulary.json"
17
 
18
  def top_elements(array, k):
 
10
 
11
  from torchmoji.sentence_tokenizer import SentenceTokenizer
12
  from torchmoji.model_def import torchmoji_emojis
13
+ from transformers import AutoModel
14
  model_name = "Uberduck/torchmoji"
15
+ model = AutoModel.from_pretrained(model_name)
16
+ model_path = model
17
  vocab_path = './' + model_name + "/vocabulary.json"
18
 
19
  def top_elements(array, k):