ise-uiuc/Magicoder-OSS-Instruct-75K
Viewer • Updated • 75.2k • 48.7k • 172
How to use 0XARTEX/artex-coder-7b with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="0XARTEX/artex-coder-7b")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("0XARTEX/artex-coder-7b")
model = AutoModelForCausalLM.from_pretrained("0XARTEX/artex-coder-7b", 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=256)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use 0XARTEX/artex-coder-7b with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "0XARTEX/artex-coder-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": "0XARTEX/artex-coder-7b",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/0XARTEX/artex-coder-7b
How to use 0XARTEX/artex-coder-7b with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "0XARTEX/artex-coder-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": "0XARTEX/artex-coder-7b",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "0XARTEX/artex-coder-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": "0XARTEX/artex-coder-7b",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use 0XARTEX/artex-coder-7b with Docker Model Runner:
docker model run hf.co/0XARTEX/artex-coder-7b
Artex is a concise, accurate, to-the-point coding assistant, fine-tuned from Qwen2.5-Coder-7B-Instruct. It answers in the user's language.
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "0XARTEX/artex-coder-7b"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype="auto", device_map="auto")
messages = [{"role": "user", "content": "Write a Python function that checks if a string is a palindrome."}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
output = model.generate(inputs, max_new_tokens=512)
print(tokenizer.decode(output[0][inputs.shape[1]:], skip_special_tokens=True))
| Base model | Qwen/Qwen2.5-Coder-7B-Instruct (bf16) |
| Method | LoRA (r=16, alpha=32, all linear layers), merged into the base weights |
| Data | 4,000 samples from Magicoder-OSS-Instruct-75K (MIT) + Artex identity conversations (EN/ID) |
| Loss | completion-only (assistant replies) |
| Epochs | 2, lr 1e-4 cosine, effective batch 16, max length 2048 |
| Hardware | 1× NVIDIA H100 80GB, ~18 minutes |
| Validation loss | 0.286 → 0.172 |
Apache 2.0, the same as the base model. The training data from Magicoder-OSS-Instruct-75K is MIT-licensed.
surplus-launcher: 0xab3fA342FEa0d30f99fEF14B3DdBa7bEc363729D