pipeline: add initial version

#1
by stefan-it - opened
Files changed (1) hide show
  1. pipeline.py +11 -0
pipeline.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import List, Dict
2
+ from wtpsplit import WtP
3
+
4
+ class PreTrainedPipeline:
5
+ def __init__(self, path=""):
6
+ self.model = WtP(model_name_or_model="wtp-canine-s-de-hist-12l", hub_prefix="stefan-it")
7
+
8
+ def __call__(self, inputs: str) -> List[Dict]:
9
+
10
+
11
+ return [{"generated_text": "</s>\n".join(sent.strip() for sent in wtp.split(text, lang_code="de", style="ud"))]