Dmitry Chaplinsky commited on
Commit
46a1011
1 Parent(s): d22b664

Almost almost there yet yet

Browse files
Files changed (1) hide show
  1. 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) -> List[str]:
14
  """
15
  Args:
16
  inputs (:obj:`str`):
@@ -19,4 +19,4 @@ class PreTrainedPipeline:
19
  A :obj:`str`
20
  """
21
  inputs = inputs.strip()
22
- return {"generated_text": [self.model.add_punctuation_capitalization(inputs)]}
 
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[str, str]:
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]}