Commit
·
27ff097
1
Parent(s):
b0d109e
align_to_words=False
Browse files- pipeline.py +5 -0
pipeline.py
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import AutoTokenizer,AutoModelForQuestionAnswering,QuestionAnsweringPipeline
|
2 |
+
|
3 |
+
class PreTrainedPipeline(QuestionAnsweringPipeline):
|
4 |
+
def __init__(self,path=""):
|
5 |
+
return super().__init__(tokenizer=AutoTokenizer.from_pretrained(path),model=AutoModelForQuestionAnswering.from_pretrained(path),align_to_words=False)
|