Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -62,7 +62,7 @@ def predict_nougat(img, model_name="facebook/nougat-small"):
|
|
62 |
processor = NougatProcessor.from_pretrained(model_name)
|
63 |
model = VisionEncoderDecoderModel.from_pretrained(model_name)
|
64 |
image = img.convert("RGB")
|
65 |
-
pixel_values = processor(image, return_tensors="pt").pixel_values
|
66 |
|
67 |
# generate transcription (here we only generate 30 tokens)
|
68 |
outputs = model.generate(
|
|
|
62 |
processor = NougatProcessor.from_pretrained(model_name)
|
63 |
model = VisionEncoderDecoderModel.from_pretrained(model_name)
|
64 |
image = img.convert("RGB")
|
65 |
+
pixel_values = processor(image, return_tensors="pt", data_format="channels_first").pixel_values
|
66 |
|
67 |
# generate transcription (here we only generate 30 tokens)
|
68 |
outputs = model.generate(
|