Skip to main content
SynapsAI Cloud requires model weights in Safetensors format. If your Hugging Face repository only contains .bin or .pt files, convert them before deploying.
Deployments fail with NoSafetensorsError when no .safetensors files are found in the repository. See Troubleshooting for the full error message.

Quick conversion with Transformers

If your model is supported by the transformers library, reload and re-save with safe_serialization=True:
pip install --upgrade transformers safetensors huggingface_hub
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "your-org/your-model"

model = AutoModelForCausalLM.from_pretrained(model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id)

# Save locally with safetensors
model.save_pretrained("./converted", safe_serialization=True)
tokenizer.save_pretrained("./converted")
Push the converted files to your Hugging Face repository:
from huggingface_hub import HfApi

api = HfApi()
api.upload_folder(
    folder_path="./converted",
    repo_id="your-org/your-model",
    repo_type="model",
)

Diffusers models

For diffusion and image models:
from diffusers import StableDiffusionPipeline

pipe = StableDiffusionPipeline.from_pretrained("your-org/your-model")
pipe.save_pretrained("./converted", safe_serialization=True)
Then upload the folder to the Hub as shown above.

Verify before deploying

  1. Confirm .safetensors files appear in the repository file list on Hugging Face.
  2. Ensure config.json, tokenizer, and processor files are present.
  3. Add a pipeline_tag to README.md (for example, pipeline_tag: text-generation).
See Launch a custom model for the full repository checklist and Deploy a model to launch.

CLI alternative

If you cloned the repository with Git:
# After saving with safe_serialization=True into the repo directory
git add *.safetensors
git commit -m "Add safetensors weights"
git push

Remote code not supported

Models that require trust_remote_code=True or custom Python modules in the repository are not supported today. Use architectures available in transformers or diffusers, or contact support if you need a custom architecture.