Instructions to use bunsenfeng/PFA_switcher_2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bunsenfeng/PFA_switcher_2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bunsenfeng/PFA_switcher_2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("bunsenfeng/PFA_switcher_2", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bunsenfeng/PFA_switcher_2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bunsenfeng/PFA_switcher_2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bunsenfeng/PFA_switcher_2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/bunsenfeng/PFA_switcher_2
- SGLang
How to use bunsenfeng/PFA_switcher_2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "bunsenfeng/PFA_switcher_2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bunsenfeng/PFA_switcher_2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "bunsenfeng/PFA_switcher_2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bunsenfeng/PFA_switcher_2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use bunsenfeng/PFA_switcher_2 with Docker Model Runner:
docker model run hf.co/bunsenfeng/PFA_switcher_2
Improve model card: Add paper details, metadata, and usage for Switch Generation
#1
by nielsr HF Staff - opened
This PR significantly improves the model card for the Switch Generation model.
Key changes include:
- Updating the metadata with
pipeline_tag: text-generationandlicense: apache-2.0for better discoverability and clarity. Thelibrary_name: transformershas been confirmed based on file evidence (tokenizer_config.json,generation_config.json,adapter_config.json). - Replacing placeholder content with a detailed model description derived from the paper's abstract.
- Adding direct links to the research paper (Don't Throw Away Your Pretrained Model) and the GitHub repository (BunsenFeng/switch_generation).
- Including the "Quick Start" code snippet directly from the GitHub README to provide immediate, actionable sample usage instructions.
- Adding a proper BibTeX citation for the paper.
These updates will greatly enhance the model's visibility, provide essential context, and improve the user experience on the Hugging Face Hub.
bunsenfeng changed pull request status to merged