Views
No views yet
| Hyperparameter | Value |
|---|---|
| Method | rsLoRA (use_rslora = true) |
LoRA rank r | 32 |
| LoRA alpha | 32 |
| Max sequence length | 8192 |
| Per-device batch | 1 |
| Gradient accumulation | 8 (effective batch 8) |
| Epochs | 1 |
| Learning rate | 2e-4 |
| Base quantization | bnb 4-bit (Unsloth) |
| Metric | Value |
|---|---|
| Feasibility | 50.0% (100/200) |
| Exact makespan | 27.5% (55/200) |
| Mean gap | 27.81% |
| Median gap | 9.37% |
| Eval time | 31.8 min |
1from peft import PeftModel
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4base = AutoModelForCausalLM.from_pretrained(
5 "Qwen/Qwen2-7B-Instruct",
6 device_map="auto",
7 torch_dtype="auto",
8)
9tok = AutoTokenizer.from_pretrained("Qwen/Qwen2-7B-Instruct")
10model = PeftModel.from_pretrained(base, "tiodh/qwen2-7b-jssp-rslora")
11
12prompt = (
13 "Optimize schedule for 3 Jobs (denoted as J) across 3 Machines (denoted as M) "
14 "to minimize makespan...\nJ0:\nM0:5 M1:3 M2:4\nJ1:\nM1:2 M0:4 M2:3\nJ2:\nM2:6 M0:1 M1:5\n"
15)
16inputs = tok(prompt, return_tensors="pt").to(model.device)
17out = model.generate(**inputs, max_new_tokens=512, temperature=0.1, top_p=0.95)
18print(tok.decode(out[0], skip_special_tokens=True))