Spaces:
Running
Running
Uddipan Basu Bir
commited on
Commit
·
5a0deb7
1
Parent(s):
419d02f
Download checkpoint from HF hub in OcrReorderPipeline
Browse files
app.py
CHANGED
@@ -97,10 +97,11 @@ def infer(image_path, json_file):
|
|
97 |
|
98 |
# Projection → T5 decoding
|
99 |
proj_feats = projection(text_feats)
|
100 |
-
gen_ids
|
101 |
inputs_embeds=proj_feats,
|
102 |
attention_mask=attention_mask,
|
103 |
-
max_length=512
|
|
|
104 |
)
|
105 |
|
106 |
# Decode to text
|
|
|
97 |
|
98 |
# Projection → T5 decoding
|
99 |
proj_feats = projection(text_feats)
|
100 |
+
gen_ids = t5_model.generate(
|
101 |
inputs_embeds=proj_feats,
|
102 |
attention_mask=attention_mask,
|
103 |
+
max_length=512,
|
104 |
+
decoder_start_token_id=t5_model.config.decoder_start_token_id
|
105 |
)
|
106 |
|
107 |
# Decode to text
|