exact_data2023/application/functions/errors.py

12 lines
374 B
Python
Raw Normal View History

2023-05-28 14:50:23 +02:00
from transformers import AutoTokenizer
from transformers import pipeline
2023-05-30 15:35:09 +02:00
# model = 'application/models/errors_model'
# tokenizer = AutoTokenizer.from_pretrained('application/tokenizers/errors_tokenizer')
2023-05-28 14:50:23 +02:00
def errors_correction(data):
pipe = pipeline("text2text-generation",model=model,tokenizer=tokenizer,max_length=2000)
result = pipe(data)
return result