Spaces:
Runtime error

LouayMagdy commited on
Commit
63a687c
·
verified ·
1 Parent(s): 519b6a4

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -2
main.py CHANGED
@@ -34,8 +34,7 @@ async def segment(files: list[UploadFile]):
34
  with tempfile.NamedTemporaryFile(suffix=".nii", delete=False) as tempFile:
35
  nib.save(output_img, tempFile.name)
36
  tempFile.seek(0) # Move cursor to the beginning of the file
37
- file_content = tempFile.read()
38
- return StreamingResponse(content=file_content, media_type="application/octet-stream")
39
 
40
  except Exception as e:
41
  print(f"Error occurred: {str(e)}")
 
34
  with tempfile.NamedTemporaryFile(suffix=".nii", delete=False) as tempFile:
35
  nib.save(output_img, tempFile.name)
36
  tempFile.seek(0) # Move cursor to the beginning of the file
37
+ return FileResponse(content=tempFile.name, media_type="multipart/form-data")
 
38
 
39
  except Exception as e:
40
  print(f"Error occurred: {str(e)}")