def fetch_checksum_from_api(organization, file):
    """Fetch the SHA-256 checksum from the model's metadata API for a given file."""
    checksum_api_url = (
        f"{ModelScopeRepository.REGISTRY_URL}/api/v1/models/{organization}/repo/raw"
        f"?Revision=master&FilePath={file}&Needmeta=true"
    )

    return fetch_checksum_from_api_base(checksum_api_url, None, extract_modelscope_checksum)
Fetch the SHA-256 checksum from the model's metadata API for a given file.
ramalama/modelscope.py