Update modeling_deepseekocr.py
Browse files- modeling_deepseekocr.py +3 -2
modeling_deepseekocr.py
CHANGED
|
@@ -703,8 +703,9 @@ class DeepseekOCRForCausalLM(DeepseekV2ForCausalLM):
|
|
| 703 |
def infer(self, tokenizer, prompt='', image_file='', output_path = '', base_size=1024, image_size=640, crop_mode=True, test_compress=False, save_results=False, eval_mode=False, streamer=None):
|
| 704 |
self.disable_torch_init()
|
| 705 |
|
| 706 |
-
|
| 707 |
-
|
|
|
|
| 708 |
|
| 709 |
if prompt and image_file:
|
| 710 |
conversation = [
|
|
|
|
| 703 |
def infer(self, tokenizer, prompt='', image_file='', output_path = '', base_size=1024, image_size=640, crop_mode=True, test_compress=False, save_results=False, eval_mode=False, streamer=None):
|
| 704 |
self.disable_torch_init()
|
| 705 |
|
| 706 |
+
if len(output_path) > 0 :
|
| 707 |
+
os.makedirs(output_path, exist_ok=True)
|
| 708 |
+
os.makedirs(f'{output_path}/images', exist_ok=True)
|
| 709 |
|
| 710 |
if prompt and image_file:
|
| 711 |
conversation = [
|