Spaces:
Runtime error
Runtime error
Update main.py
Browse files
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 |
-
|
| 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)}")
|