Run this model with HF Jobs

Run masterofthestars/tianxuan on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/masterofthestars/tianxuan. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/masterofthestars/tianxuan on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/masterofthestars/tianxuan. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/masterofthestars/tianxuan. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
File size: 1,634 Bytes
db7bc06
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
# ============================================================
# 天玄完整训练脚本(可复现)
# 用法: bash scripts/train-full.sh [续训]
# 首次训练: bash scripts/train-full.sh
# 续训:     bash scripts/train-full.sh resume
# ============================================================
set -euo pipefail
cd "$(dirname "$0")/.."

CK="sandbox/ck-full-multi"
LOG_DIR="sandbox/logs"

# 确保沙箱编译产物存在
if [ ! -d "sandbox/dist/ml" ]; then
  echo "[*] 首次运行, 编译 TypeScript → sandbox/dist ..."
  rm -rf sandbox/dist
  npx tsc --outDir sandbox/dist
fi

# 确保语料存在
if [ ! -f "data/corpus.txt" ] || [ "$(wc -c < data/corpus.txt)" -lt 100000 ]; then
  echo "[*] 生成训练语料(500万字符)..."
  node -e "
    const { buildCorpus } = require('./sandbox/dist/src/ml/data');
    const fs = require('fs');
    fs.mkdirSync('data', { recursive: true });
    const b = buildCorpus({ seed: 7, tokens: 5000000, rawPerFile: 30000 });
    fs.writeFileSync('data/corpus.txt', b.text, 'utf-8');
    console.log('语料: ' + b.text.length + ' 字符');
  "
fi

mkdir -p "$LOG_DIR"

if [ "${1:-}" = "resume" ] && [ -f "$CK/meta.json" ]; then
  echo "[*] 续训模式: 从 $CK 检查点继续"
  cd sandbox
  exec node ../sandbox/dist/src/ml/train.js \
    --resume ck-full-multi \
    --epochs 2 --lr 0.002 --ckpt 50 --out ck-full-multi
else
  echo "[*] 从头训练"
  cd sandbox
  exec node ../sandbox/dist/src/ml/train.js \
    --tokens 5000000 --epochs 2 --lr 0.002 \
    --hidden 256 --emb 64 --bptt 32 \
    --attn 1 --mamba 1 --cnn 1 \
    --ckpt 50 --out ck-full-multi
fi