12 lines
370 B
Python
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
|