Spaces:
Running
on
Zero
Running
on
Zero
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -34,6 +34,7 @@ try:
|
|
| 34 |
processor = AutoProcessor.from_pretrained(MODEL_ID, trust_remote_code=True)
|
| 35 |
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 36 |
MODEL_ID,
|
|
|
|
| 37 |
trust_remote_code=True,
|
| 38 |
torch_dtype=torch.float16,
|
| 39 |
device_map="auto"
|
|
@@ -164,4 +165,4 @@ if __name__ == "__main__":
|
|
| 164 |
clear.click(gradio_reset, inputs=None, outputs=[input_img, pred_otsl, output_html, rendered_html])
|
| 165 |
predict.click(recognize_image, inputs=[input_img, max_tokens, temperature], outputs=[pred_otsl, output_html, rendered_html])
|
| 166 |
|
| 167 |
-
demo.launch(
|
|
|
|
| 34 |
processor = AutoProcessor.from_pretrained(MODEL_ID, trust_remote_code=True)
|
| 35 |
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 36 |
MODEL_ID,
|
| 37 |
+
attn_implementation="flash_attention_2",
|
| 38 |
trust_remote_code=True,
|
| 39 |
torch_dtype=torch.float16,
|
| 40 |
device_map="auto"
|
|
|
|
| 165 |
clear.click(gradio_reset, inputs=None, outputs=[input_img, pred_otsl, output_html, rendered_html])
|
| 166 |
predict.click(recognize_image, inputs=[input_img, max_tokens, temperature], outputs=[pred_otsl, output_html, rendered_html])
|
| 167 |
|
| 168 |
+
demo.launch(ssr_mode=False, show_error=True)
|