flip_api.file_services.download_file ==================================== .. py:module:: flip_api.file_services.download_file Attributes ---------- .. autoapisummary:: flip_api.file_services.download_file.router Functions --------- .. autoapisummary:: flip_api.file_services.download_file.download_file Module Contents --------------- .. py:data:: router .. py:function:: download_file(model_id: uuid.UUID, file_name: flip_api.domain.schemas.file.SafeFileName, db: sqlmodel.Session = Depends(get_session), user_id: uuid.UUID = Depends(verify_token)) -> fastapi.responses.StreamingResponse Download a 'model file' (file uploaded by a user to train/evaluate a model). Important: Do not confuse with the 'retrieve_federated_results' endpoint which is for downloading 'model results' generated as a result of a training/evaluation job and are stored in a different S3 bucket. While 'observer' users can download 'model results' using the 'retrieve_federated_results' endpoint, only users with 'modify' access to a model can download 'model files' using this 'download_file' endpoint. :param model_id: The ID of the model to retrieve the file for. :type model_id: UUID :param file_name: The name of the file to download. :type file_name: str :param db: Database session. :type db: Session :param user_id: User ID from authentication. :type user_id: UUID :returns: A streaming response containing the file content. :rtype: StreamingResponse :raises HTTPException: If the user is not allowed, if the file does not exist, or there is an error during the download process.