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
Update README.md
Browse files
README.md
CHANGED
|
@@ -42,13 +42,13 @@ The model was trained on [@l2k's tweets](https://twitter.com/l2k).
|
|
| 42 |
| Short tweets | 61 |
|
| 43 |
| Tweets kept | 1886 |
|
| 44 |
|
| 45 |
-
[Explore the data](https://app.wandb.ai/borisd13/huggingtweets/runs/
|
| 46 |
|
| 47 |
## Training procedure
|
| 48 |
|
| 49 |
The model is based on a pre-trained [GPT-2](https://huggingface.co/gpt2) which is fine-tuned on @l2k's tweets for 4 epochs.
|
| 50 |
|
| 51 |
-
Hyperparameters and metrics are recorded in the [W&B training run](https://app.wandb.ai/borisd13/huggingtweets/runs/
|
| 52 |
|
| 53 |
## Intended uses & limitations
|
| 54 |
|
|
|
|
| 42 |
| Short tweets | 61 |
|
| 43 |
| Tweets kept | 1886 |
|
| 44 |
|
| 45 |
+
[Explore the data](https://app.wandb.ai/borisd13/huggingtweets/runs/1pntgyh6/artifacts), which is tracked with [W&B artifacts](https://docs.wandb.com/artifacts) at every step of the pipeline.
|
| 46 |
|
| 47 |
## Training procedure
|
| 48 |
|
| 49 |
The model is based on a pre-trained [GPT-2](https://huggingface.co/gpt2) which is fine-tuned on @l2k's tweets for 4 epochs.
|
| 50 |
|
| 51 |
+
Hyperparameters and metrics are recorded in the [W&B training run](https://app.wandb.ai/borisd13/huggingtweets/runs/xxn1yrvo).
|
| 52 |
|
| 53 |
## Intended uses & limitations
|
| 54 |
|