Gleb Vinarskis
commited on
Commit
·
db3682f
1
Parent(s):
26d45f0
addded registration
Browse files
impresso_langident_wrapper.py
CHANGED
@@ -1,4 +1,8 @@
|
|
1 |
from transformers import Pipeline
|
|
|
|
|
|
|
|
|
2 |
class Pipeline_One(Pipeline):
|
3 |
def _sanitize_parameters(self, **kwargs):
|
4 |
# Add any additional parameter handling if necessary
|
@@ -12,4 +16,12 @@ class Pipeline_One(Pipeline):
|
|
12 |
return model_output
|
13 |
|
14 |
def postprocess(self, outputs, **kwargs):
|
15 |
-
return outputs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from transformers import Pipeline
|
2 |
+
from transformers.pipelines import PIPELINE_REGISTRY
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
class Pipeline_One(Pipeline):
|
7 |
def _sanitize_parameters(self, **kwargs):
|
8 |
# Add any additional parameter handling if necessary
|
|
|
16 |
return model_output
|
17 |
|
18 |
def postprocess(self, outputs, **kwargs):
|
19 |
+
return outputs
|
20 |
+
|
21 |
+
|
22 |
+
# Register the pipeline
|
23 |
+
PIPELINE_REGISTRY.register_pipeline(
|
24 |
+
"language-detection",
|
25 |
+
pipeline_class=Pipeline_One,
|
26 |
+
pt_model="Maslionok/pipeline1",
|
27 |
+
)
|