Dmitry Chaplinsky
commited on
Commit
·
062350e
1
Parent(s):
1f399b4
switching to hf hub
Browse files- 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 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
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]:
|