byh711 commited on
Commit
843ce1e
·
verified ·
1 Parent(s): 95cb17f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -22,11 +22,11 @@ doc_converter = DocumentConverter(
22
  def convert_to_markdown(file):
23
  # Save the uploaded file to a temporary path
24
  input_path = Path(file.name)
25
- file.save(str(input_path))
 
26
 
27
  # Convert the document
28
  result = doc_converter.convert(str(input_path))
29
-
30
 
31
  # Prepare output directory
32
  output_dir = Path("output")
 
22
  def convert_to_markdown(file):
23
  # Save the uploaded file to a temporary path
24
  input_path = Path(file.name)
25
+ with open(input_path, 'wb') as f:
26
+ f.write(file.read())
27
 
28
  # Convert the document
29
  result = doc_converter.convert(str(input_path))
 
30
 
31
  # Prepare output directory
32
  output_dir = Path("output")