Instructions to use Deepraj21/slm-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Deepraj21/slm-model with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM2-1.7B") model = PeftModel.from_pretrained(base_model, "Deepraj21/slm-model") - Transformers
How to use Deepraj21/slm-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Deepraj21/slm-model")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Deepraj21/slm-model", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Deepraj21/slm-model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Deepraj21/slm-model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Deepraj21/slm-model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Deepraj21/slm-model
- SGLang
How to use Deepraj21/slm-model 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 "Deepraj21/slm-model" \ --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": "Deepraj21/slm-model", "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 "Deepraj21/slm-model" \ --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": "Deepraj21/slm-model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Deepraj21/slm-model with Docker Model Runner:
docker model run hf.co/Deepraj21/slm-model
Model save
Browse files- README.md +66 -0
- tokenizer.json +0 -0
- tokenizer_config.json +34 -0
README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: peft
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model: HuggingFaceTB/SmolLM2-1.7B
|
| 5 |
+
tags:
|
| 6 |
+
- base_model:adapter:HuggingFaceTB/SmolLM2-1.7B
|
| 7 |
+
- lora
|
| 8 |
+
- transformers
|
| 9 |
+
pipeline_tag: text-generation
|
| 10 |
+
model-index:
|
| 11 |
+
- name: slm-model
|
| 12 |
+
results: []
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 16 |
+
should probably proofread and complete it, then remove this comment. -->
|
| 17 |
+
|
| 18 |
+
# slm-model
|
| 19 |
+
|
| 20 |
+
This model is a fine-tuned version of [HuggingFaceTB/SmolLM2-1.7B](https://huggingface.co/HuggingFaceTB/SmolLM2-1.7B) on the None dataset.
|
| 21 |
+
It achieves the following results on the evaluation set:
|
| 22 |
+
- Loss: 0.4884
|
| 23 |
+
|
| 24 |
+
## Model description
|
| 25 |
+
|
| 26 |
+
More information needed
|
| 27 |
+
|
| 28 |
+
## Intended uses & limitations
|
| 29 |
+
|
| 30 |
+
More information needed
|
| 31 |
+
|
| 32 |
+
## Training and evaluation data
|
| 33 |
+
|
| 34 |
+
More information needed
|
| 35 |
+
|
| 36 |
+
## Training procedure
|
| 37 |
+
|
| 38 |
+
### Training hyperparameters
|
| 39 |
+
|
| 40 |
+
The following hyperparameters were used during training:
|
| 41 |
+
- learning_rate: 0.0002
|
| 42 |
+
- train_batch_size: 1
|
| 43 |
+
- eval_batch_size: 1
|
| 44 |
+
- seed: 42
|
| 45 |
+
- gradient_accumulation_steps: 8
|
| 46 |
+
- total_train_batch_size: 8
|
| 47 |
+
- optimizer: Use adamw_torch_fused with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 48 |
+
- lr_scheduler_type: cosine
|
| 49 |
+
- lr_scheduler_warmup_steps: 0.03
|
| 50 |
+
- num_epochs: 3
|
| 51 |
+
- mixed_precision_training: Native AMP
|
| 52 |
+
|
| 53 |
+
### Training results
|
| 54 |
+
|
| 55 |
+
| Training Loss | Epoch | Step | Validation Loss |
|
| 56 |
+
|:-------------:|:-----:|:----:|:---------------:|
|
| 57 |
+
| 0.4907 | 3.0 | 159 | 0.4884 |
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
### Framework versions
|
| 61 |
+
|
| 62 |
+
- PEFT 0.19.1
|
| 63 |
+
- Transformers 5.6.2
|
| 64 |
+
- Pytorch 2.11.0+cu130
|
| 65 |
+
- Datasets 4.8.5
|
| 66 |
+
- Tokenizers 0.22.2
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<|endoftext|>",
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|endoftext|>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"extra_special_tokens": [
|
| 9 |
+
"<|endoftext|>",
|
| 10 |
+
"<|im_start|>",
|
| 11 |
+
"<|im_end|>",
|
| 12 |
+
"<repo_name>",
|
| 13 |
+
"<reponame>",
|
| 14 |
+
"<file_sep>",
|
| 15 |
+
"<filename>",
|
| 16 |
+
"<gh_stars>",
|
| 17 |
+
"<issue_start>",
|
| 18 |
+
"<issue_comment>",
|
| 19 |
+
"<issue_closed>",
|
| 20 |
+
"<jupyter_start>",
|
| 21 |
+
"<jupyter_text>",
|
| 22 |
+
"<jupyter_code>",
|
| 23 |
+
"<jupyter_output>",
|
| 24 |
+
"<jupyter_script>",
|
| 25 |
+
"<empty_output>"
|
| 26 |
+
],
|
| 27 |
+
"is_local": false,
|
| 28 |
+
"local_files_only": false,
|
| 29 |
+
"model_max_length": 8192,
|
| 30 |
+
"pad_token": "<|endoftext|>",
|
| 31 |
+
"tokenizer_class": "GPT2Tokenizer",
|
| 32 |
+
"unk_token": "<|endoftext|>",
|
| 33 |
+
"vocab_size": 49152
|
| 34 |
+
}
|