Slayer1B-1.09-Instruct-26.11: weights, card, notes, training code, manifests and results (history squashed; training data not published)
6071ec5 Download training/code/demo.py from SlayerLab/Slayer1B-1.09-Instruct-26.11: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/SlayerLab/Slayer1B-1.09-Instruct-26.11/resolve/main/training/code/demo.py
- Command line
-
hf download hf://SlayerLab/Slayer1B-1.09-Instruct-26.11/training/code/demo.py
-
curl -L -o demo.py https://huggingface.co/SlayerLab/Slayer1B-1.09-Instruct-26.11/resolve/main/training/code/demo.py
1.16 kB
| import json, sys, torch | |
| from tokenizers import Tokenizer | |
| from chatfmt import Fmt | |
| from evals import Runner, run_loop | |
| from model_io import load | |
| import tools_suite as T | |
| m, cfg, _ = load(sys.argv[1], device="cuda", dtype=torch.bfloat16); m.eval() | |
| f = Fmt(Tokenizer.from_file("/workspace/ckpt/tokenizer.json")); r = Runner(m, f, 300) | |
| for p in ["Cześć! Możesz mi krótko wyjaśnić, czym jest fotosynteza?", "What are three tips for writing a good cover letter?", | |
| "Popraw błędy w zdaniu: 'Wczoraj poszłem do sklepu i kupiłem chleba.'", "Napisz krótki wiersz o morzu, cztery wersy."]: | |
| t, why = r.reply([{"role": "user", "content": p}]) | |
| print("=== USER:", p, "\n--- SLAYER:", t, f"[{why}]\n") | |
| cases = {c["prompt"]: c for c in T.cases()} | |
| for p in ["Jaka jest teraz pogoda w Krakowie?", "Convert 100 EUR to PLN.", "Cześć! Jak się masz?"]: | |
| c = cases[p] | |
| o = run_loop(r, c, forced=False) | |
| print("=== LOOP:", p, "| tools:", [t["name"] for t in c["tools"]]) | |
| for s in o["trace"]: | |
| print(" ASSISTANT:", s["assistant"][:400].replace("\n", "\n"), "| results:", s.get("results")) | |
| print(" FINAL:", o["final"][:300], "\n") | |