exact_data2023/application/functions/errors.py
2023-05-28 14:50:23 +02:00

12 lines
370 B
Python

from transformers import AutoTokenizer
from transformers import pipeline
model = 'application/models/errors_model'
tokenizer = AutoTokenizer.from_pretrained('application/tokenizers/errors_tokenizer')
def errors_correction(data):
pipe = pipeline("text2text-generation",model=model,tokenizer=tokenizer,max_length=2000)
result = pipe(data)
return result