jed-tiotuico commited on
Commit
7c36b85
1 Parent(s): 86d04de

changed to abspath

Browse files
Files changed (1) hide show
  1. handler.py +6 -2
handler.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  from tokenizers import ByteLevelBPETokenizer, Tokenizer
2
  from typing import Dict, List, Any
3
  from transformers import pipeline
@@ -47,9 +49,11 @@ class EndpointHandler:
47
  }
48
  lstm = get_model()
49
  model = lstm.from_pretrained("jed-tiotuico/aurelio-rnn", config=config)
 
 
50
  tokenizer = ByteLevelBPETokenizer(
51
- "./aurelio_bpe-vocab.json",
52
- "./aurelio_bpe-merges.txt",
53
  )
54
  # create inference pipeline
55
  self.pipeline = pipeline("text-generation", model=model, tokenizer=tokenizer)
 
1
+ import os.path
2
+
3
  from tokenizers import ByteLevelBPETokenizer, Tokenizer
4
  from typing import Dict, List, Any
5
  from transformers import pipeline
 
49
  }
50
  lstm = get_model()
51
  model = lstm.from_pretrained("jed-tiotuico/aurelio-rnn", config=config)
52
+
53
+ dir_path = os.path.abspath(os.path.dirname(__file__))
54
  tokenizer = ByteLevelBPETokenizer(
55
+ os.path.join(dir_path, "aurelio_bpe-vocab.json"),
56
+ os.path.join(dir_path, "aurelio_bpe-merges.txt"),
57
  )
58
  # create inference pipeline
59
  self.pipeline = pipeline("text-generation", model=model, tokenizer=tokenizer)