uartimcs commited on
Commit
875cd79
·
verified ·
1 Parent(s): b215e79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -20,13 +20,17 @@ def demo_process(input_pdf):
20
 
21
  with open(os.path.join(temp_dir, image_name), "wb") as f:
22
  f.write(image_bytes)
23
-
 
24
  image_path = os.path.join(temp_dir, image_name)
25
 
 
 
 
26
  os.remove(image_path)
27
  os.rmdir(temp_dir)
28
 
29
- return image_path
30
 
31
  # task_name = "SGSInvoice"
32
  # task_prompt = f"<s_{task_name}>"
 
20
 
21
  with open(os.path.join(temp_dir, image_name), "wb") as f:
22
  f.write(image_bytes)
23
+
24
+ zip_path = "images.zip"
25
  image_path = os.path.join(temp_dir, image_name)
26
 
27
+ with zipfile.ZipFile(zip_path, "w") as zipf:
28
+ zipf.write(os.path.join(temp_dir, image_name), image_name)
29
+
30
  os.remove(image_path)
31
  os.rmdir(temp_dir)
32
 
33
+ return zip_path
34
 
35
  # task_name = "SGSInvoice"
36
  # task_prompt = f"<s_{task_name}>"