Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ feature_extractor = ViTFeatureExtractor.from_pretrained("google/vit-large-patch3
|
|
7 |
|
8 |
def run_ocr(image):
|
9 |
pixel_values = feature_extractor(image, return_tensors="pt").pixel_values
|
10 |
-
# autoregressively generate caption (uses greedy decoding by default)
|
11 |
generated_ids = model.generate(pixel_values, max_new_tokens=50)
|
12 |
generated_text = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
13 |
return generated_text
|
|
|
7 |
|
8 |
def run_ocr(image):
|
9 |
pixel_values = feature_extractor(image, return_tensors="pt").pixel_values
|
10 |
+
# autoregressively generate caption (uses greedy decoding by default )
|
11 |
generated_ids = model.generate(pixel_values, max_new_tokens=50)
|
12 |
generated_text = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
13 |
return generated_text
|