Instructions to use huggingtweets/l2k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use huggingtweets/l2k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="huggingtweets/l2k")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("huggingtweets/l2k") model = AutoModelForCausalLM.from_pretrained("huggingtweets/l2k", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use huggingtweets/l2k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "huggingtweets/l2k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "huggingtweets/l2k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/huggingtweets/l2k
- SGLang
How to use huggingtweets/l2k 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 "huggingtweets/l2k" \ --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": "huggingtweets/l2k", "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 "huggingtweets/l2k" \ --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": "huggingtweets/l2k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use huggingtweets/l2k with Docker Model Runner:
docker model run hf.co/huggingtweets/l2k
Commit History
-
Update README.md
51a412f
-
Update README.md
9cfc773 -
Update README.md
2d68b9e -
Update README.md
6e9fac1
-
Update README.md
8b10654
-
Update README.md
ce00ca3
-
Update README.md
e625418
-
Update README.md
1527db2 -
Update README.md
543c608 -
Update README.md
c3c0571
-
Update README.md
279f1db -
Update README.md
af62082 -
Update README.md
5fb50b6 -
Update README.md
fbd6fc1 -
Update README.md
af51741 -
Update README.md
22a19e9 -
Update README.md
9be3ca4 -
Update README.md
bdcfc47 -
Update README.md
96f6e67 -
Update README.md
7a46a53 -
Update README.md
980e550 -
Update README.md
9ae2fc3 -
Update README.md
19c9ff6 -
Update README.md
ad531ba
-
Update README.md
a201cd0 -
Update README.md
3e1b6bf -
Update README.md
e84553c -
Update README.md
875e08b -
Update README.md
08877e5 -
Update README.md
e0f8476 -
Update README.md
bd5b8f2 -
Update README.md
bb53373 -
Update README.md
31498ba -
Update README.md
c97b926 -
Update README.md
85823d8 -
Update README.md
1b567f6