Text Generation
Transformers
Safetensors
qwen2
merlina
grimoire
sft
conversational
text-generation-inference
Instructions to use hemlang/Hemlock-Codex-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hemlang/Hemlock-Codex-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hemlang/Hemlock-Codex-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("hemlang/Hemlock-Codex-7B") model = AutoModelForCausalLM.from_pretrained("hemlang/Hemlock-Codex-7B") 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
- vLLM
How to use hemlang/Hemlock-Codex-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hemlang/Hemlock-Codex-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hemlang/Hemlock-Codex-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/hemlang/Hemlock-Codex-7B
- SGLang
How to use hemlang/Hemlock-Codex-7B 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 "hemlang/Hemlock-Codex-7B" \ --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": "hemlang/Hemlock-Codex-7B", "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 "hemlang/Hemlock-Codex-7B" \ --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": "hemlang/Hemlock-Codex-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use hemlang/Hemlock-Codex-7B with Docker Model Runner:
docker model run hf.co/hemlang/Hemlock-Codex-7B
Add model card with training configuration
Browse files
README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
pipeline_tag: text-generation
|
| 4 |
+
tags:
|
| 5 |
+
- merlina
|
| 6 |
+
- grimoire
|
| 7 |
+
- text-generation
|
| 8 |
+
- sft
|
| 9 |
+
datasets:
|
| 10 |
+
- hemlang/hemlock-codex-SFT
|
| 11 |
+
base_model:
|
| 12 |
+
- hemlang/Hemlock2-Coder-7B
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# Hemlock-Codex-7B
|
| 16 |
+
|
| 17 |
+
## Training Configuration
|
| 18 |
+
|
| 19 |
+
| Parameter | Value |
|
| 20 |
+
|-----------|-------|
|
| 21 |
+
| Training Mode | SFT |
|
| 22 |
+
| Base Model | `hemlang/Hemlock2-Coder-7B` |
|
| 23 |
+
| Learning Rate | 0.0001 |
|
| 24 |
+
| Epochs | 3 |
|
| 25 |
+
| Batch Size | 2 |
|
| 26 |
+
| Gradient Accumulation | 16 |
|
| 27 |
+
| Effective Batch Size | 32 |
|
| 28 |
+
| Max Sequence Length | 8192 |
|
| 29 |
+
| Optimizer | paged_adamw_8bit |
|
| 30 |
+
| LR Scheduler | cosine |
|
| 31 |
+
| Warmup Ratio | 0.05 |
|
| 32 |
+
| Weight Decay | 0.01 |
|
| 33 |
+
| Max Grad Norm | 0.25 |
|
| 34 |
+
| Seed | 42 |
|
| 35 |
+
| LoRA Rank (r) | 128 |
|
| 36 |
+
| LoRA Alpha | 128 |
|
| 37 |
+
| LoRA Dropout | 0.05 |
|
| 38 |
+
| Target Modules | k_proj, o_proj, q_proj, v_proj, down_proj, gate_proj, up_proj |
|
| 39 |
+
| Quantization | 4-bit (NF4) |
|
| 40 |
+
| GPU | NVIDIA RTX A6000 |
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
|
| 46 |
+
[Merlina on GitHub](https://github.com/Schneewolf-Labs/Merlina)
|