Instructions to use ereniko/SmolLLM2-135M-Code with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ereniko/SmolLLM2-135M-Code with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM2-135M-Instruct") model = PeftModel.from_pretrained(base_model, "ereniko/SmolLLM2-135M-Code") - Transformers
How to use ereniko/SmolLLM2-135M-Code with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ereniko/SmolLLM2-135M-Code") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ereniko/SmolLLM2-135M-Code", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ereniko/SmolLLM2-135M-Code with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ereniko/SmolLLM2-135M-Code" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ereniko/SmolLLM2-135M-Code", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ereniko/SmolLLM2-135M-Code
- SGLang
How to use ereniko/SmolLLM2-135M-Code 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 "ereniko/SmolLLM2-135M-Code" \ --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": "ereniko/SmolLLM2-135M-Code", "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 "ereniko/SmolLLM2-135M-Code" \ --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": "ereniko/SmolLLM2-135M-Code", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ereniko/SmolLLM2-135M-Code with Docker Model Runner:
docker model run hf.co/ereniko/SmolLLM2-135M-Code
Update README.md
Browse files
README.md
CHANGED
|
@@ -18,6 +18,8 @@ license: cc-by-nc-4.0
|
|
| 18 |
This model is a fine-tuned version of [HuggingFaceTB/SmolLM2-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct).
|
| 19 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 20 |
|
|
|
|
|
|
|
| 21 |
## Quick start
|
| 22 |
|
| 23 |
```python
|
|
@@ -38,10 +40,6 @@ ask("Write a Python function to reverse a string")
|
|
| 38 |
|
| 39 |
## Training procedure
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
This model was trained with SFT.
|
| 46 |
|
| 47 |
### Framework versions
|
|
|
|
| 18 |
This model is a fine-tuned version of [HuggingFaceTB/SmolLM2-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct).
|
| 19 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 20 |
|
| 21 |
+
It's not anything magic, I just made this to test an Nvidia A30. It's hard to find on the cloud, but it's a really nice budget GPU for training with its low price and HBM.
|
| 22 |
+
|
| 23 |
## Quick start
|
| 24 |
|
| 25 |
```python
|
|
|
|
| 40 |
|
| 41 |
## Training procedure
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
This model was trained with SFT.
|
| 44 |
|
| 45 |
### Framework versions
|