Instructions to use cccczshao/CALM-L with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cccczshao/CALM-L with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cccczshao/CALM-L")# Load model directly from transformers import EnergyTransformer model = EnergyTransformer.from_pretrained("cccczshao/CALM-L", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use cccczshao/CALM-L with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cccczshao/CALM-L" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cccczshao/CALM-L", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cccczshao/CALM-L
- SGLang
How to use cccczshao/CALM-L 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 "cccczshao/CALM-L" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cccczshao/CALM-L", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "cccczshao/CALM-L" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cccczshao/CALM-L", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cccczshao/CALM-L with Docker Model Runner:
docker model run hf.co/cccczshao/CALM-L
Update metadata: add pipeline_tag and set library_name to transformers
#1
by nielsr HF Staff - opened
This PR improves the model card by:
- Adding the
pipeline_tag: text-generationto accurately categorize the model's functionality on the Hub, as it aligns with the paper's description of 'Continuous Autoregressive Language Models' and 'next-token prediction'. This will enhance model discoverability. - Updating the
library_namefromCALMtotransformers. Evidence fromconfig.json(e.g.,transformers_version: "4.43.0") andtokenizer_config.json(tokenizer_class: "PreTrainedTokenizerFast") indicates compatibility with thetransformerslibrary, likely used withtrust_remote_code=Truefor custom architectures. This change will enable the automatedtransformerscode snippet for easier model usage on the Hub.
No sample usage code is added as the provided GitHub README does not contain a Python inference snippet, adhering to the guideline not to make up code. The existing links to the paper, GitHub, and project page are retained.
cccczshao changed pull request status to merged