Dmitry Chaplinsky
commited on
Commit
•
3c45d75
1
Parent(s):
6475faf
Ah fml
Browse files- pipeline.py +2 -3
pipeline.py
CHANGED
@@ -7,8 +7,7 @@ class PreTrainedPipeline:
|
|
7 |
from huggingface_hub import hf_hub_download
|
8 |
|
9 |
self.model = KeyedVectors.load_word2vec_format(
|
10 |
-
hf_hub_download(repo_id="lang-uk/word2vec-uk", filename="ubercorpus.cased.tokenized.300d"),
|
11 |
-
binary=False
|
12 |
)
|
13 |
|
14 |
def __call__(self, inputs: str) -> List[Dict]:
|
@@ -20,4 +19,4 @@ class PreTrainedPipeline:
|
|
20 |
A :obj:`str`
|
21 |
"""
|
22 |
inputs = inputs.strip()
|
23 |
-
return [{"generated_text": "\n".join(f"{k}\t{v}" for k, v in self.model.most_similar(inputs, topn=30))
|
|
|
7 |
from huggingface_hub import hf_hub_download
|
8 |
|
9 |
self.model = KeyedVectors.load_word2vec_format(
|
10 |
+
hf_hub_download(repo_id="lang-uk/word2vec-uk", filename="ubercorpus.cased.tokenized.300d"), binary=False
|
|
|
11 |
)
|
12 |
|
13 |
def __call__(self, inputs: str) -> List[Dict]:
|
|
|
19 |
A :obj:`str`
|
20 |
"""
|
21 |
inputs = inputs.strip()
|
22 |
+
return [{"generated_text": "\n".join(f"{k}\t{v}" for k, v in self.model.most_similar(inputs, topn=30))}]
|