Text Generation
Transformers
Safetensors
English
qwen2
text-generation-inference
unsloth
trl
sft
conversational
4-bit precision
bitsandbytes
Instructions to use VortexHunter23/Shed-Coder-0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use VortexHunter23/Shed-Coder-0.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="VortexHunter23/Shed-Coder-0.1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("VortexHunter23/Shed-Coder-0.1") model = AutoModelForCausalLM.from_pretrained("VortexHunter23/Shed-Coder-0.1", 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 VortexHunter23/Shed-Coder-0.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "VortexHunter23/Shed-Coder-0.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "VortexHunter23/Shed-Coder-0.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/VortexHunter23/Shed-Coder-0.1
- SGLang
How to use VortexHunter23/Shed-Coder-0.1 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 "VortexHunter23/Shed-Coder-0.1" \ --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": "VortexHunter23/Shed-Coder-0.1", "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 "VortexHunter23/Shed-Coder-0.1" \ --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": "VortexHunter23/Shed-Coder-0.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use VortexHunter23/Shed-Coder-0.1 with Docker Model Runner:
docker model run hf.co/VortexHunter23/Shed-Coder-0.1
Update README.md
Browse files
README.md
CHANGED
|
@@ -11,6 +11,40 @@ license: apache-2.0
|
|
| 11 |
language:
|
| 12 |
- en
|
| 13 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# Uploaded model
|
| 16 |
|
|
|
|
| 11 |
language:
|
| 12 |
- en
|
| 13 |
---
|
| 14 |
+
from trl import SFTTrainer
|
| 15 |
+
from transformers import TrainingArguments
|
| 16 |
+
from unsloth import is_bfloat16_supported
|
| 17 |
+
|
| 18 |
+
trainer = SFTTrainer(
|
| 19 |
+
model = model,
|
| 20 |
+
tokenizer = tokenizer,
|
| 21 |
+
train_dataset = dataset,
|
| 22 |
+
dataset_text_field = "text",
|
| 23 |
+
max_seq_length = max_seq_length,
|
| 24 |
+
dataset_num_proc = 2,
|
| 25 |
+
packing = False, # Can make training 5x faster for short sequences.
|
| 26 |
+
args = TrainingArguments(
|
| 27 |
+
per_device_train_batch_size = 2,
|
| 28 |
+
gradient_accumulation_steps = 4,
|
| 29 |
+
warmup_steps = 5,
|
| 30 |
+
num_train_epochs = 1, # Set this for 1 full training run.
|
| 31 |
+
max_steps = 100,
|
| 32 |
+
learning_rate = 2e-4,
|
| 33 |
+
fp16 = not is_bfloat16_supported(),
|
| 34 |
+
bf16 = is_bfloat16_supported(),
|
| 35 |
+
logging_steps = 1,
|
| 36 |
+
optim = "adamw_8bit",
|
| 37 |
+
weight_decay = 0.01,
|
| 38 |
+
lr_scheduler_type = "linear",
|
| 39 |
+
seed = 3407,
|
| 40 |
+
output_dir = "outputs",
|
| 41 |
+
save_strategy = "steps",
|
| 42 |
+
save_steps = 60,
|
| 43 |
+
report_to = "none", # Use this for WandB etc
|
| 44 |
+
),
|
| 45 |
+
)
|
| 46 |
+
|
| 47 |
+
|
| 48 |
|
| 49 |
# Uploaded model
|
| 50 |
|