Instructions to use liufanfanlff/C3-Context-Cascade-Compression with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use liufanfanlff/C3-Context-Cascade-Compression with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="liufanfanlff/C3-Context-Cascade-Compression", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("liufanfanlff/C3-Context-Cascade-Compression", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use liufanfanlff/C3-Context-Cascade-Compression with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "liufanfanlff/C3-Context-Cascade-Compression" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "liufanfanlff/C3-Context-Cascade-Compression", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/liufanfanlff/C3-Context-Cascade-Compression
- SGLang
How to use liufanfanlff/C3-Context-Cascade-Compression 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 "liufanfanlff/C3-Context-Cascade-Compression" \ --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": "liufanfanlff/C3-Context-Cascade-Compression", "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 "liufanfanlff/C3-Context-Cascade-Compression" \ --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": "liufanfanlff/C3-Context-Cascade-Compression", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use liufanfanlff/C3-Context-Cascade-Compression with Docker Model Runner:
docker model run hf.co/liufanfanlff/C3-Context-Cascade-Compression
Update model card: add pipeline, library tags, correct license, and fix paper link
#1
by nielsr HF Staff - opened
This PR improves the model card for the C3-Context-Cascade-Compression model by:
- Adding
pipeline_tag: text-generationfor better discoverability on the Hub, as the model performs text compression and decoding. - Adding
library_name: transformers, enabling the automated "How to use" widget, as evidenced by thetransformerslibrary usage in the code snippet andconfig.json. - Updating the
licensefrommittoapache-2.0, aligning with the code license explicitly specified in the GitHub repository. - Correcting the broken paper link in the main title to the official Hugging Face paper page.
- Removing a redundant metadata block (
--- license: mit ---) from the content section, as metadata should only appear in the YAML front matter.
These changes enhance the model's visibility and user experience on the Hugging Face Hub.
liufanfanlff changed pull request status to merged