Text Generation
Transformers
Safetensors
llama
Generated from Trainer
dpo
trl
conversational
text-generation-inference
Instructions to use BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1") model = AutoModelForCausalLM.from_pretrained("BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1
- SGLang
How to use BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1 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 "BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1" \ --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": "BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1", "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 "BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1" \ --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": "BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1 with Docker Model Runner:
docker model run hf.co/BKM1804/ebd3853f-27cd-4553-82ef-b572dab7b9c1
Model save
Browse files- README.md +5 -4
- adapter_config.json +7 -10
- adapter_model.safetensors +1 -1
- tokenizer_config.json +1 -0
- training_args.bin +1 -1
README.md
CHANGED
|
@@ -1,17 +1,18 @@
|
|
| 1 |
---
|
| 2 |
-
base_model:
|
| 3 |
library_name: transformers
|
| 4 |
model_name: ebd3853f-27cd-4553-82ef-b572dab7b9c1
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
| 7 |
- dpo
|
| 8 |
- trl
|
|
|
|
| 9 |
licence: license
|
| 10 |
---
|
| 11 |
|
| 12 |
# Model Card for ebd3853f-27cd-4553-82ef-b572dab7b9c1
|
| 13 |
|
| 14 |
-
This model is a fine-tuned version of [
|
| 15 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 16 |
|
| 17 |
## Quick start
|
|
@@ -27,7 +28,7 @@ print(output["generated_text"])
|
|
| 27 |
|
| 28 |
## Training procedure
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
|
| 33 |
This model was trained with DPO, a method introduced in [Direct Preference Optimization: Your Language Model is Secretly a Reward Model](https://huggingface.co/papers/2305.18290).
|
|
@@ -36,7 +37,7 @@ This model was trained with DPO, a method introduced in [Direct Preference Optim
|
|
| 36 |
|
| 37 |
- TRL: 0.21.0
|
| 38 |
- Transformers: 4.55.0
|
| 39 |
-
- Pytorch: 2.7.
|
| 40 |
- Datasets: 3.6.0
|
| 41 |
- Tokenizers: 0.21.4
|
| 42 |
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: unsloth/Qwen2-1.5B-Instruct
|
| 3 |
library_name: transformers
|
| 4 |
model_name: ebd3853f-27cd-4553-82ef-b572dab7b9c1
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
| 7 |
- dpo
|
| 8 |
- trl
|
| 9 |
+
- unsloth
|
| 10 |
licence: license
|
| 11 |
---
|
| 12 |
|
| 13 |
# Model Card for ebd3853f-27cd-4553-82ef-b572dab7b9c1
|
| 14 |
|
| 15 |
+
This model is a fine-tuned version of [unsloth/Qwen2-1.5B-Instruct](https://huggingface.co/unsloth/Qwen2-1.5B-Instruct).
|
| 16 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 17 |
|
| 18 |
## Quick start
|
|
|
|
| 28 |
|
| 29 |
## Training procedure
|
| 30 |
|
| 31 |
+
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/buikhacminh1804/sn56-dpo-train/runs/oovhw4uw)
|
| 32 |
|
| 33 |
|
| 34 |
This model was trained with DPO, a method introduced in [Direct Preference Optimization: Your Language Model is Secretly a Reward Model](https://huggingface.co/papers/2305.18290).
|
|
|
|
| 37 |
|
| 38 |
- TRL: 0.21.0
|
| 39 |
- Transformers: 4.55.0
|
| 40 |
+
- Pytorch: 2.7.0
|
| 41 |
- Datasets: 3.6.0
|
| 42 |
- Tokenizers: 0.21.4
|
| 43 |
|
adapter_config.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
"base_model_class": "Qwen2ForCausalLM",
|
| 5 |
"parent_library": "transformers.models.qwen2.modeling_qwen2"
|
| 6 |
},
|
| 7 |
-
"base_model_name_or_path": "
|
| 8 |
"bias": "none",
|
| 9 |
"corda_config": null,
|
| 10 |
"eva_config": null,
|
|
@@ -18,7 +18,7 @@
|
|
| 18 |
"loftq_config": {},
|
| 19 |
"lora_alpha": 256,
|
| 20 |
"lora_bias": false,
|
| 21 |
-
"lora_dropout": 0,
|
| 22 |
"megatron_config": null,
|
| 23 |
"megatron_core": "megatron.core",
|
| 24 |
"modules_to_save": null,
|
|
@@ -28,16 +28,13 @@
|
|
| 28 |
"rank_pattern": {},
|
| 29 |
"revision": null,
|
| 30 |
"target_modules": [
|
| 31 |
-
"
|
| 32 |
-
"dense_h_to_4h",
|
| 33 |
-
"v_proj",
|
| 34 |
-
"dense_4h_to_h",
|
| 35 |
-
"down_proj",
|
| 36 |
-
"q_proj",
|
| 37 |
"o_proj",
|
| 38 |
-
"
|
|
|
|
| 39 |
"gate_proj",
|
| 40 |
-
"
|
|
|
|
| 41 |
],
|
| 42 |
"target_parameters": null,
|
| 43 |
"task_type": null,
|
|
|
|
| 4 |
"base_model_class": "Qwen2ForCausalLM",
|
| 5 |
"parent_library": "transformers.models.qwen2.modeling_qwen2"
|
| 6 |
},
|
| 7 |
+
"base_model_name_or_path": "unsloth/Qwen2-1.5B-Instruct",
|
| 8 |
"bias": "none",
|
| 9 |
"corda_config": null,
|
| 10 |
"eva_config": null,
|
|
|
|
| 18 |
"loftq_config": {},
|
| 19 |
"lora_alpha": 256,
|
| 20 |
"lora_bias": false,
|
| 21 |
+
"lora_dropout": 0.05,
|
| 22 |
"megatron_config": null,
|
| 23 |
"megatron_core": "megatron.core",
|
| 24 |
"modules_to_save": null,
|
|
|
|
| 28 |
"rank_pattern": {},
|
| 29 |
"revision": null,
|
| 30 |
"target_modules": [
|
| 31 |
+
"k_proj",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
"o_proj",
|
| 33 |
+
"q_proj",
|
| 34 |
+
"down_proj",
|
| 35 |
"gate_proj",
|
| 36 |
+
"v_proj",
|
| 37 |
+
"up_proj"
|
| 38 |
],
|
| 39 |
"target_parameters": null,
|
| 40 |
"task_type": null,
|
adapter_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 590925768
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a9deb1cb83df35e07016a8424200366f491487db272574830d75361120230926
|
| 3 |
size 590925768
|
tokenizer_config.json
CHANGED
|
@@ -37,6 +37,7 @@
|
|
| 37 |
"extra_special_tokens": {},
|
| 38 |
"model_max_length": 32768,
|
| 39 |
"pad_token": "<|endoftext|>",
|
|
|
|
| 40 |
"split_special_tokens": false,
|
| 41 |
"tokenizer_class": "Qwen2Tokenizer",
|
| 42 |
"unk_token": null
|
|
|
|
| 37 |
"extra_special_tokens": {},
|
| 38 |
"model_max_length": 32768,
|
| 39 |
"pad_token": "<|endoftext|>",
|
| 40 |
+
"padding_side": "left",
|
| 41 |
"split_special_tokens": false,
|
| 42 |
"tokenizer_class": "Qwen2Tokenizer",
|
| 43 |
"unk_token": null
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 6993
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e3744309d5bd91cbc003e477210afa9af9f0354355d4a241bce89dc6653e3143
|
| 3 |
size 6993
|