Views
No views yet
alpha=32 scaling factor.q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, and down_proj. This ensures the model learns the syntax of build orders (Timings + Unit Names) rather than just the "vibe" of SC2 chat.| Phase | Action | Purpose |
|---|---|---|
| Extraction | sc2reader Level 3 Tracker Events | Captured precise UnitBorn and UnitInit timings. |
| Filtering | 4500+ MMR Threshold | Excluded non-professional playstyles to ensure "meta" accuracy. |
| Sanitization | Regex-based Unit Filtering | Removed accidental worker clicks and "spam" actions to reduce noise. |
| Normalization | Relative Timestamps | Converted raw game ticks into readable MM:SS format. |
### Raw Data Example (Alpaca Format)
```json
{
"instruction": "You are a Terran Grandmaster coach specializing in TvP.",
"input": "Matchup: TvP. Scenario: Professional Opening.",
"output": "0:12 SCV\n0:38 Supply Depot\n0:45 Refinery\n1:20 Barracks\n1:40 Reaper"
}Matchup: TvT. Scout: Enemy SCV missing, double gas taken, Starport started near natural.2:01 Cyclone and a Raven rather than a third Command Center.League: Gold for simpler builds).1from unsloth import FastLanguageModel
2import torch
3
4# 1. Load the model (Ensures 4-bit for speed/efficiency)
5model, tokenizer = FastLanguageModel.from_pretrained(
6 model_name = "spdev45/sc2-strategy-adapter",
7 max_seq_length = 2048,
8 load_in_4bit = True,
9)
10FastLanguageModel.for_inference(model)
11
12# 2. Define the exact Alpaca prompt used during training
13alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
14
15### Instruction:
16{}
17
18### Input:
19{}
20
21### Response:
22{}"""
23
24# 3. Format the input
25inputs = tokenizer(
26[
27 alpaca_prompt.format(
28 "You are a Terran GM coach. Provide a tight build order response.", # Instruction
29 "Matchup: TvT. Scout: Enemy SCV missing, double gas, Starport proxy suspected.", # Input
30 "", # Response - leave empty for generation!
31 )
32], return_tensors = "pt").to("cuda")
33
34# 4. Generate
35outputs = model.generate(**inputs, max_new_tokens = 128)
36response = tokenizer.batch_decode(outputs)
37print(response[0].split("### Response:")[1])