Downloads · 30 days
4
9% of all-time downloads
vcvcvn/infi-room-qwen3-4b-dag
infi-room-qwen3-4b-dag is a text generation model from vcvcvn. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This model generates DAG-structured escape-room game data for the infi-room frontend. It was fine-tuned with SWIFT LoRA from a Qwen3 4B Instruct base model and then merged into full Hugging Face Transformers weights.
Downloads · 30 days
4
9% of all-time downloads
All-time downloads
46
Public
Parameters
4B
8.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8 GB · 100%
From the Hugging Face model README
This model generates DAG-structured escape-room game data for the infi-room frontend.
It was fine-tuned with SWIFT LoRA from a Qwen3 4B Instruct base model and then merged into full Hugging Face Transformers weights.
这个模型用于生成密室逃脱的 DAG 图数据,可配合 infi-room 前端展示为可玩的卡片式密室逃脱。训练流程使用 SWIFT LoRA 微调,当前仓库上传的是已经合并 LoRA 的完整 Transformers 权重。
Qwen/Qwen3-4B-Instruct-2507checkpoint-6000The model is intended to produce JSON-like room data with this shape:
{
"scene": "...",
"nodes": [
{
"id": "node-id",
"name": "Node name",
"type": "key | tool | clue | puzzle | part | container | gate | item | decoration",
"description": "What the player sees or learns.",
"password": null,
"reversible": null
}
],
"edges": [
{
"from": "source-node-id",
"to": "target-node-id",
"type": "extract | combine | decode | open"
}
]
}
Chinese generation prompt:
sys_prompt = f"生成密室逃脱的dag图,要求场景:{scene},节点数量:{node_count}"
user_content = "开始生成"
English generation prompt:
sys_prompt = f"Generate a DAG graph for an escape room, requirements: scene: {scene}, number of nodes: {node_count}"
user_content = "Start generation"
The training/inference code used these branches:
if original_lang == "en" and final_lang == "cn":
sys_prompt = f"生成密室逃脱的dag图,要求场景:{scene},节点数量:{node_count}"
user_content = "开始生成"
else:
if final_lang == "en":
if not use_template:
orig_sys = data.get("system_prompt", "")
sys_prompt = orig_sys.replace("str(r1)-str(r2)", str(node_count))
else:
sys_prompt = f"Generate a DAG graph for an escape room, requirements: scene: {scene}, number of nodes: {node_count}"
user_content = "Start generation"
Use recent versions of the Qwen-compatible Transformers stack. The model was exported in an environment close to:
pip install "transformers>=4.57" "torch>=2.0" accelerate safetensors
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "vcvcvn/infi-room-qwen3-4b-dag"
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
scene = "一间废弃天文台,出口被星盘锁住"
node_count = 12
messages = [
{
"role": "system",
"content": f"生成密室逃脱的dag图,要求场景:{scene},节点数量:{node_count}",
},
{"role": "user", "content": "开始生成"},
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
with torch.no_grad():
output_ids = model.generate(
**inputs,
max_new_tokens=4096,
temperature=0.7,
top_p=0.9,
do_sample=True,
)
generated_ids = output_ids[0, inputs.input_ids.shape[-1]:]
print(tokenizer.decode(generated_ids, skip_special_tokens=True))
.json file.infi-room browser UI.This is a beta research/demo model. Generated rooms should be validated before use: the model may produce malformed JSON, unreachable nodes, impossible puzzles, or edges that need manual cleanup.