Dmitry Chaplinsky commited on
Commit
062350e
1 Parent(s): 1f399b4

switching to hf hub

Browse files
Files changed (1) hide show
  1. pipeline.py +4 -5
pipeline.py CHANGED
@@ -1,14 +1,13 @@
1
- import os.path
2
  from typing import List, Dict
3
  from flair.models.language_model import LanguageModel
4
 
5
 
6
  class PreTrainedPipeline:
7
  def __init__(self, path=""):
8
- # IMPLEMENT_THIS
9
- # Preload all the elements you are going to need at inference.
10
- # For instance your model, processors, tokenizer that might be needed.
11
- # This function is only called once, so do all the heavy processing I/O here"""
12
  self.model = LanguageModel.load_language_model("best-lm.pt")
13
 
14
  def __call__(self, inputs: str) -> List[Dict]:
 
 
1
  from typing import List, Dict
2
  from flair.models.language_model import LanguageModel
3
 
4
 
5
  class PreTrainedPipeline:
6
  def __init__(self, path=""):
7
+ from huggingface_hub import hf_hub_download
8
+
9
+ hf_hub_download(repo_id="dchaplinsky/flair-uk-forward", filename="best-lm.pt")
10
+
11
  self.model = LanguageModel.load_language_model("best-lm.pt")
12
 
13
  def __call__(self, inputs: str) -> List[Dict]: