Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ tokenizer = AutoTokenizer.from_pretrained(decoder_checkpoint)
|
|
12 |
model = VisionEncoderDecoderModel.from_pretrained(model_checkpoint).to(device)
|
13 |
|
14 |
|
15 |
-
def predict(image,max_length=
|
16 |
image = image.convert('RGB')
|
17 |
image = feature_extractor(image, return_tensors="pt").pixel_values.to(device)
|
18 |
clean_text = lambda x: x.replace('<|endoftext|>','').split('\n')[0]
|
|
|
12 |
model = VisionEncoderDecoderModel.from_pretrained(model_checkpoint).to(device)
|
13 |
|
14 |
|
15 |
+
def predict(image,max_length=24, num_beams=4):
|
16 |
image = image.convert('RGB')
|
17 |
image = feature_extractor(image, return_tensors="pt").pixel_values.to(device)
|
18 |
clean_text = lambda x: x.replace('<|endoftext|>','').split('\n')[0]
|