You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i try someting like this (after downloaded ROBERTA model):
from transformers import TrOCRProcessor, VisionEncoderDecoderModel
from PIL import Image
from functools import wraps
import time
def job():
image=Image.open("Screenshot_1.jpg")
#model_version = "microsoft/trocr-small-printed"
model_version = "ruberta_base"
processor = TrOCRProcessor.from_pretrained(model_version)
pixel_values = processor(image, return_tensors="bin").pixel_values
model = VisionEncoderDecoderModel.from_pretrained(model_version)
generated_ids = model.generate(pixel_values)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(generated_text)
job()
but failed with: OSError: ruberta_base does not appear to have a file named preprocessor_config.json. Checkout 'https://huggingface.co/ruberta_base/main' for available files.
The text was updated successfully, but these errors were encountered:
could you provide any inference example ?
i try someting like this (after downloaded ROBERTA model):
but failed with:
OSError: ruberta_base does not appear to have a file named preprocessor_config.json. Checkout 'https://huggingface.co/ruberta_base/main' for available files.
The text was updated successfully, but these errors were encountered: