Spaces:
Running
Running
Update interfaces/base_pipeline.py
Browse files
interfaces/base_pipeline.py
CHANGED
@@ -29,8 +29,7 @@ def generate_pipeline(threshold: float = 0.5):
|
|
29 |
|
30 |
tokenizer = AutoTokenizer.from_pretrained("knowledgator/UTC-DeBERTa-large-v2")
|
31 |
model = AutoModelForTokenClassification.from_pretrained("knowledgator/UTC-DeBERTa-large-v2")
|
32 |
-
|
33 |
-
transformers_pipeline = pipeline(device=torch.device("cpu"), task="ner", model ="knowledgator/UTC-DeBERTa-small", pipeline_class =TokenClassificationPipeline, aggregation_strategy = "first", batch_size = 12)
|
34 |
|
35 |
if __name__=="__main__":
|
36 |
pipeline = generate_pipeline()
|
|
|
29 |
|
30 |
tokenizer = AutoTokenizer.from_pretrained("knowledgator/UTC-DeBERTa-large-v2")
|
31 |
model = AutoModelForTokenClassification.from_pretrained("knowledgator/UTC-DeBERTa-large-v2")
|
32 |
+
transformers_pipeline = TokenClassificationPipeline(device=device=torch.device("cpu"), model=model, tokenizer=tokenizer, aggregation_strategy = 'first')
|
|
|
33 |
|
34 |
if __name__=="__main__":
|
35 |
pipeline = generate_pipeline()
|