jonathanjordan21 commited on
Commit
9786e20
·
verified ·
1 Parent(s): 8784ec2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -25,11 +25,11 @@ async def upload_file(file: UploadFile = File(...)):
25
  # shutil.copyfileobj(file.file, buffer)
26
 
27
  with tempfile.NamedTemporaryFile(delete=False, suffix=file.filename) as temp_file:
28
- # Efficiently write the uploaded file's content to the temporary file
29
- contents = await file.read()
30
- temp_file.write(contents)
31
 
32
- temp_file_path = temp_file.name
33
 
34
  # result = process_with_langchain(file_path)
35
 
 
25
  # shutil.copyfileobj(file.file, buffer)
26
 
27
  with tempfile.NamedTemporaryFile(delete=False, suffix=file.filename) as temp_file:
28
+ # Efficiently write the uploaded file's content to the temporary file
29
+ contents = await file.read()
30
+ temp_file.write(contents)
31
 
32
+ temp_file_path = temp_file.name
33
 
34
  # result = process_with_langchain(file_path)
35