teja123098 commited on
Commit
cd04dd8
·
verified ·
1 Parent(s): 1cb1d9c

Upload 6 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,3 +1,105 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  license: apache-2.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ base_model: Qwen/Qwen3-8B
3
+ library_name: peft
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - lora
7
+ - qlora
8
+ - peft
9
+ - transformers
10
+ - godot
11
+ - game-development
12
+ - code-generation
13
+ - text-generation
14
+ language:
15
+ - en
16
  license: apache-2.0
17
  ---
18
+
19
+ # SoloLabs GameForge 1
20
+
21
+ **SoloLabs GameForge** is a QLoRA adapter for [Qwen/Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B), fine-tuned to assist with complete Godot 4 game creation from natural-language prompts. It is intended to generate and explain GDScript, Godot scene trees, project structure, 3D-game mechanics, asset manifests, and Web-preview-oriented build instructions.
22
+
23
+ This repository contains the **LoRA adapter**, not the full Qwen3-8B base-model weights. The base model is downloaded separately by Transformers from `Qwen/Qwen3-8B`.
24
+
25
+ ## Model details
26
+
27
+ | Field | Value |
28
+ |---|---|
29
+ | Model name | SoloLabs GameForge 1 |
30
+ | Fine-tuning method | QLoRA / PEFT LoRA |
31
+ | Base model | Qwen/Qwen3-8B |
32
+ | LoRA rank | 16 |
33
+ | LoRA alpha | 32 |
34
+ | LoRA dropout | 0.05 |
35
+ | Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
36
+ | Training records | 8,000 total; 6,400 train, 800 validation, 800 test |
37
+ | Intended domain | Godot 4 code and 3D game project generation |
38
+
39
+ ## Intended use
40
+
41
+ Use the adapter for prototyping Godot 4 projects, generating GDScript and scene-tree plans, drafting 3D-game mechanics, creating asset manifests, and explaining how to validate a generated project. The associated SoloLabs pipeline adds structural project checks, Godot Web export, headless Playwright preview verification, and allowlisted public asset discovery.
42
+
43
+ The model should be treated as a coding assistant and project generator. Generated code must be reviewed, tested, and security-checked before use. Asset downloads must be independently reviewed for license compatibility before redistribution.
44
+
45
+ ## Important limitations
46
+
47
+ The adapter is not a standalone 8B model; it must be loaded on top of Qwen3-8B. The model's native output can use a design-object schema, while the production materializer expects a canonical file-list schema. The validated pipeline detects this mismatch, preserves the raw generation, and can use a deterministic procedural fallback for execution.
48
+
49
+ The Kaggle validation demonstrated a working Godot Web export and headless Playwright verification. Android APK export remained blocked by a Godot 4.4.1 headless Android-preset validation problem in the Kaggle environment. This model card does not claim that every prompt produces a finished commercial game or a guaranteed APK.
50
+
51
+ ## Loading the adapter
52
+
53
+ ```python
54
+ import torch
55
+ from transformers import AutoModelForCausalLM, AutoTokenizer
56
+ from peft import PeftModel
57
+
58
+ base_id = "Qwen/Qwen3-8B"
59
+ adapter_id = "teja123098/sololabs.1"
60
+
61
+ tokenizer = AutoTokenizer.from_pretrained(adapter_id, trust_remote_code=True)
62
+ base = AutoModelForCausalLM.from_pretrained(
63
+ base_id,
64
+ torch_dtype=torch.float16,
65
+ device_map="auto",
66
+ trust_remote_code=True,
67
+ )
68
+ model = PeftModel.from_pretrained(base, adapter_id)
69
+ model.eval()
70
+
71
+ prompt = "Create a Godot 4 third-person 3D arena shooter with a player, two weapons, enemies, pickups, and a Web preview. Return a complete project file manifest with GDScript and scene trees."
72
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
73
+ with torch.no_grad():
74
+ output = model.generate(**inputs, max_new_tokens=2048, do_sample=False)
75
+ print(tokenizer.decode(output[0], skip_special_tokens=True))
76
+ ```
77
+
78
+ For low-memory inference, load the base model using a compatible 4-bit `BitsAndBytesConfig` and then attach this adapter with `PeftModel.from_pretrained`.
79
+
80
+ ## Training summary
81
+
82
+ The adapter was trained on Kaggle using QLoRA with 4-bit NF4 quantization, double quantization, FP16 compute, LoRA rank 16, alpha 32, dropout 0.05, and the seven attention/MLP projection target-module groups listed above. The dataset contains 8,000 structured examples covering Godot 4 project generation, GDScript, 3D gameplay, gun-game mechanics, scene trees, asset manifests, Web export, and validation workflows.
83
+
84
+ ## Responsible use
85
+
86
+ Do not use generated code to introduce malware, evade software protections, infringe third-party assets, or deploy unsafe systems. Review all generated scripts and dependencies. Treat web-discovered assets as untrusted until their source, license, checksum, and compatibility have been verified.
87
+
88
+ ## Related resources
89
+
90
+ - Base model: [Qwen/Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B)
91
+ - Godot Engine: [godotengine.org](https://godotengine.org/)
92
+ - Playwright: [playwright.dev](https://playwright.dev/)
93
+ - SoloLabs GameForge Kaggle notebook: [tej8789/notebookcbedb4fe86](https://www.kaggle.com/code/tej8789/notebookcbedb4fe86)
94
+ - Training adapter source dataset: [tej8789/sololabs-gameforge-qwen3-8b-lora-v8](https://www.kaggle.com/datasets/tej8789/sololabs-gameforge-qwen3-8b-lora-v8)
95
+
96
+ ## Citation
97
+
98
+ ```bibtex
99
+ @misc{sololabs_gameforge_2026,
100
+ title = {SoloLabs GameForge 1},
101
+ author = {SoloLabs},
102
+ year = {2026},
103
+ note = {QLoRA adapter for Qwen3-8B specialized in Godot 4 game generation}
104
+ }
105
+ ```
adapter_config.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "Qwen/Qwen3-8B",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 32,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "lora_ga_config": null,
23
+ "megatron_config": null,
24
+ "megatron_core": "megatron.core",
25
+ "modules_to_save": null,
26
+ "monteclora_config": null,
27
+ "peft_type": "LORA",
28
+ "peft_version": "0.20.0",
29
+ "qalora_group_size": 16,
30
+ "r": 16,
31
+ "rank_pattern": {},
32
+ "revision": null,
33
+ "target_modules": [
34
+ "down_proj",
35
+ "o_proj",
36
+ "up_proj",
37
+ "v_proj",
38
+ "q_proj",
39
+ "k_proj",
40
+ "gate_proj"
41
+ ],
42
+ "target_parameters": null,
43
+ "task_type": "CAUSAL_LM",
44
+ "trainable_token_indices": null,
45
+ "use_bdlora": null,
46
+ "use_dora": false,
47
+ "use_qalora": false,
48
+ "use_rslora": false,
49
+ "velora_config": null
50
+ }
chat_template.jinja ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0].role == 'system' %}
4
+ {{- messages[0].content + '\n\n' }}
5
+ {%- endif %}
6
+ {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
7
+ {%- for tool in tools %}
8
+ {{- "\n" }}
9
+ {{- tool | tojson }}
10
+ {%- endfor %}
11
+ {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
12
+ {%- else %}
13
+ {%- if messages[0].role == 'system' %}
14
+ {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
15
+ {%- endif %}
16
+ {%- endif %}
17
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
18
+ {%- for message in messages[::-1] %}
19
+ {%- set index = (messages|length - 1) - loop.index0 %}
20
+ {%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
21
+ {%- set ns.multi_step_tool = false %}
22
+ {%- set ns.last_query_index = index %}
23
+ {%- endif %}
24
+ {%- endfor %}
25
+ {%- for message in messages %}
26
+ {%- if message.content is string %}
27
+ {%- set content = message.content %}
28
+ {%- else %}
29
+ {%- set content = '' %}
30
+ {%- endif %}
31
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
32
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
33
+ {%- elif message.role == "assistant" %}
34
+ {%- set reasoning_content = '' %}
35
+ {%- if message.reasoning_content is string %}
36
+ {%- set reasoning_content = message.reasoning_content %}
37
+ {%- else %}
38
+ {%- if '</think>' in content %}
39
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
40
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
41
+ {%- endif %}
42
+ {%- endif %}
43
+ {%- if loop.index0 > ns.last_query_index %}
44
+ {%- if loop.last or (not loop.last and reasoning_content) %}
45
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
46
+ {%- else %}
47
+ {{- '<|im_start|>' + message.role + '\n' + content }}
48
+ {%- endif %}
49
+ {%- else %}
50
+ {{- '<|im_start|>' + message.role + '\n' + content }}
51
+ {%- endif %}
52
+ {%- if message.tool_calls %}
53
+ {%- for tool_call in message.tool_calls %}
54
+ {%- if (loop.first and content) or (not loop.first) %}
55
+ {{- '\n' }}
56
+ {%- endif %}
57
+ {%- if tool_call.function %}
58
+ {%- set tool_call = tool_call.function %}
59
+ {%- endif %}
60
+ {{- '<tool_call>\n{"name": "' }}
61
+ {{- tool_call.name }}
62
+ {{- '", "arguments": ' }}
63
+ {%- if tool_call.arguments is string %}
64
+ {{- tool_call.arguments }}
65
+ {%- else %}
66
+ {{- tool_call.arguments | tojson }}
67
+ {%- endif %}
68
+ {{- '}\n</tool_call>' }}
69
+ {%- endfor %}
70
+ {%- endif %}
71
+ {{- '<|im_end|>\n' }}
72
+ {%- elif message.role == "tool" %}
73
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
74
+ {{- '<|im_start|>user' }}
75
+ {%- endif %}
76
+ {{- '\n<tool_response>\n' }}
77
+ {{- content }}
78
+ {{- '\n</tool_response>' }}
79
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
80
+ {{- '<|im_end|>\n' }}
81
+ {%- endif %}
82
+ {%- endif %}
83
+ {%- endfor %}
84
+ {%- if add_generation_prompt %}
85
+ {{- '<|im_start|>assistant\n' }}
86
+ {%- if enable_thinking is defined and enable_thinking is false %}
87
+ {{- '<think>\n\n</think>\n\n' }}
88
+ {%- endif %}
89
+ {%- endif %}
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b064181fd20c7d19d5613f061552279d7dcbb8210ffde80386e2a9a6ddf996e7
3
+ size 11422748
tokenizer_config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "extra_special_tokens": [
9
+ "<|im_start|>",
10
+ "<|im_end|>",
11
+ "<|object_ref_start|>",
12
+ "<|object_ref_end|>",
13
+ "<|box_start|>",
14
+ "<|box_end|>",
15
+ "<|quad_start|>",
16
+ "<|quad_end|>",
17
+ "<|vision_start|>",
18
+ "<|vision_end|>",
19
+ "<|vision_pad|>",
20
+ "<|image_pad|>",
21
+ "<|video_pad|>"
22
+ ],
23
+ "is_local": false,
24
+ "model_max_length": 131072,
25
+ "pad_token": "<|endoftext|>",
26
+ "split_special_tokens": false,
27
+ "tokenizer_class": "Qwen2Tokenizer",
28
+ "unk_token": null
29
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a1b7f4d9839e7122f616461cd3816184a8011fca2950e2c50f952d7481564ee
3
+ size 5201