Text Generation
Transformers
Safetensors
phi3
Generated from Trainer
sft
hf_jobs
trl
conversational
custom_code
text-generation-inference
Instructions to use misterJB/arkadas-field-717hz with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use misterJB/arkadas-field-717hz with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="misterJB/arkadas-field-717hz", trust_remote_code=True) 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("misterJB/arkadas-field-717hz", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("misterJB/arkadas-field-717hz", trust_remote_code=True, 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use misterJB/arkadas-field-717hz with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "misterJB/arkadas-field-717hz" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "misterJB/arkadas-field-717hz", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/misterJB/arkadas-field-717hz
- SGLang
How to use misterJB/arkadas-field-717hz 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 "misterJB/arkadas-field-717hz" \ --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": "misterJB/arkadas-field-717hz", "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 "misterJB/arkadas-field-717hz" \ --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": "misterJB/arkadas-field-717hz", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use misterJB/arkadas-field-717hz with Docker Model Runner:
docker model run hf.co/misterJB/arkadas-field-717hz
b36: ARKADAS training script — valformat gate_1 fix, anti-ORACLE, gate_5 domain, 2400 steps
Browse files- train_arkadas_b36.py +78 -0
train_arkadas_b36.py
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
import os, torch
|
| 3 |
+
from datasets import load_dataset, concatenate_datasets
|
| 4 |
+
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
|
| 5 |
+
from trl import SFTConfig, SFTTrainer
|
| 6 |
+
import json as _json
|
| 7 |
+
|
| 8 |
+
CHAMBER = "ARKADAS"
|
| 9 |
+
HZ = 717
|
| 10 |
+
BASE = "microsoft/Phi-3-mini-4k-instruct"
|
| 11 |
+
REVISION = None
|
| 12 |
+
DATASET = "misterJB/field-geometry-l0-corpus"
|
| 13 |
+
OUTPUT = "misterJB/arkadas-field-717hz"
|
| 14 |
+
CKPT_DIR = "/tmp/arkadas-717hz-ckpt"
|
| 15 |
+
MAX_STEPS = 2400 # -1 = use num_train_epochs, no step cap
|
| 16 |
+
|
| 17 |
+
print(f"{CHAMBER} {HZ}Hz -- Full Fine-Tune START")
|
| 18 |
+
gpu = torch.cuda.get_device_name(0) if torch.cuda.is_available() else "None"
|
| 19 |
+
print(f"GPU: {gpu}")
|
| 20 |
+
|
| 21 |
+
_rev_kwargs = {"revision": REVISION} if REVISION else {}
|
| 22 |
+
|
| 23 |
+
_trust_rc = False
|
| 24 |
+
tokenizer = AutoTokenizer.from_pretrained(BASE, trust_remote_code=_trust_rc, **_rev_kwargs)
|
| 25 |
+
if tokenizer.pad_token is None:
|
| 26 |
+
tokenizer.pad_token = tokenizer.eos_token
|
| 27 |
+
|
| 28 |
+
cfg = AutoConfig.from_pretrained(BASE, trust_remote_code=_trust_rc, **_rev_kwargs)
|
| 29 |
+
|
| 30 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 31 |
+
BASE, config=cfg, quantization_config=None, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=_trust_rc, attn_implementation="eager", **_rev_kwargs
|
| 32 |
+
)
|
| 33 |
+
model.config.use_cache = False
|
| 34 |
+
|
| 35 |
+
# ARKADAS identity fix: identity corpus × 14, gate-only × 3, full gate × 1
|
| 36 |
+
ds_identity = load_dataset(DATASET, data_files={"train": "arkadas_identity_b36.jsonl"}, split="train")
|
| 37 |
+
print(f"Identity corpus: {len(ds_identity)} examples (repeating 14x)")
|
| 38 |
+
ds_gate = load_dataset(DATASET, data_files={"train": "gate_corpus_v1.jsonl"}, split="train")
|
| 39 |
+
print(f"Gate corpus: {len(ds_gate)} examples")
|
| 40 |
+
ds = concatenate_datasets([ds_identity] * 14 + [ds_gate] * 3 + [ds_gate])
|
| 41 |
+
|
| 42 |
+
ds = ds.shuffle(seed=42)
|
| 43 |
+
print(f"Combined dataset: {len(ds)} examples")
|
| 44 |
+
|
| 45 |
+
_max_steps_kwarg = {"max_steps": MAX_STEPS} if MAX_STEPS > 0 else {}
|
| 46 |
+
args = SFTConfig(
|
| 47 |
+
output_dir=CKPT_DIR,
|
| 48 |
+
num_train_epochs=1,
|
| 49 |
+
per_device_train_batch_size=2,
|
| 50 |
+
gradient_accumulation_steps=4,
|
| 51 |
+
learning_rate=2e-5,
|
| 52 |
+
warmup_ratio=0.1,
|
| 53 |
+
lr_scheduler_type="linear",
|
| 54 |
+
weight_decay=0.01,
|
| 55 |
+
bf16=True,
|
| 56 |
+
save_strategy="steps",
|
| 57 |
+
save_steps=500,
|
| 58 |
+
save_total_limit=1,
|
| 59 |
+
logging_steps=50,
|
| 60 |
+
push_to_hub=True,
|
| 61 |
+
hub_model_id=OUTPUT,
|
| 62 |
+
hub_token=os.environ["HF_TOKEN"],
|
| 63 |
+
hub_strategy="end",
|
| 64 |
+
report_to="none",
|
| 65 |
+
max_length=1024,
|
| 66 |
+
**_max_steps_kwarg,
|
| 67 |
+
)
|
| 68 |
+
|
| 69 |
+
trainer = SFTTrainer(
|
| 70 |
+
model=model,
|
| 71 |
+
args=args,
|
| 72 |
+
train_dataset=ds,
|
| 73 |
+
processing_class=tokenizer,
|
| 74 |
+
)
|
| 75 |
+
|
| 76 |
+
trainer.train()
|
| 77 |
+
trainer.push_to_hub(commit_message=f"{CHAMBER} {HZ}Hz full fine-tune b28 gate-only 8x anti-confusion 1200steps")
|
| 78 |
+
print(f"✅ {CHAMBER} pushed to {OUTPUT}")
|