Dmitry Chaplinsky
commited on
Commit
•
a6b9062
1
Parent(s):
46a1011
FFS
Browse files- pipeline.py +2 -2
pipeline.py
CHANGED
@@ -10,7 +10,7 @@ class PreTrainedPipeline:
|
|
10 |
# This function is only called once, so do all the heavy processing I/O here"""
|
11 |
self.model = PunctuationCapitalizationModel.from_pretrained("dchaplinsky/punctuation_uk_bert")
|
12 |
|
13 |
-
def __call__(self, inputs: str) -> Dict
|
14 |
"""
|
15 |
Args:
|
16 |
inputs (:obj:`str`):
|
@@ -19,4 +19,4 @@ class PreTrainedPipeline:
|
|
19 |
A :obj:`str`
|
20 |
"""
|
21 |
inputs = inputs.strip()
|
22 |
-
return
|
|
|
10 |
# This function is only called once, so do all the heavy processing I/O here"""
|
11 |
self.model = PunctuationCapitalizationModel.from_pretrained("dchaplinsky/punctuation_uk_bert")
|
12 |
|
13 |
+
def __call__(self, inputs: str) -> List[Dict]:
|
14 |
"""
|
15 |
Args:
|
16 |
inputs (:obj:`str`):
|
|
|
19 |
A :obj:`str`
|
20 |
"""
|
21 |
inputs = inputs.strip()
|
22 |
+
return ["generated_text": self.model.add_punctuation_capitalization([inputs])[0]]
|