Instructions to use RanenSim/RoomAudit-Lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- Unsloth Desktop
Upload folder using huggingface_hub
Browse filesFiles changed (14)
- .gitattributes+1
- lora_adapter_agent/README.mdAdded+117
- lora_adapter_agent/adapter_config.jsonAdded+42
- lora_adapter_agent/adapter_model.safetensorsAdded+3
- lora_adapter_agent/added_tokens.jsonAdded+28
- lora_adapter_agent/chat_template.jinjaAdded+120
- lora_adapter_agent/debug.logAdded+1
- lora_adapter_agent/merges.txtAdded
- lora_adapter_agent/preprocessor_config.jsonAdded+39
- lora_adapter_agent/special_tokens_map.jsonAdded+31
- lora_adapter_agent/tokenizer.jsonAdded+3
- lora_adapter_agent/tokenizer_config.jsonAdded+241
- lora_adapter_agent/video_preprocessor_config.jsonAdded+41
- lora_adapter_agent/vocab.jsonAdded
34 unmodified lines35363734 unmodified lines*tfevents* filter=lfs diff=lfs merge=lfs -textlora_adapter/tokenizer.json filter=lfs diff=lfs merge=lfs -textlora_adapter_vit/tokenizer.json filter=lfs diff=lfs merge=lfs -text34 unmodified lines3536373834 unmodified lines*tfevents* filter=lfs diff=lfs merge=lfs -textlora_adapter/tokenizer.json filter=lfs diff=lfs merge=lfs -textlora_adapter_vit/tokenizer.json filter=lfs diff=lfs merge=lfs -textlora_adapter_agent/tokenizer.json filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117---base_model: unsloth/Qwen3-VL-4B-Instruct-unsloth-bnb-4bitlibrary_name: peftlicense: apache-2.0language:- enpipeline_tag: image-text-to-texttags:- base_model:adapter:unsloth/Qwen3-VL-4B-Instruct-unsloth-bnb-4bit- lora- qlora- sft- vision- hotel- cleanliness-detection- agentic- unsloth---
# roomaudit — agentic LoRA adapter
QLoRA adapter for Qwen3-VL-4B-Instruct, fine-tuned on a two-turn agentic inspection format. Part of the roomaudit project.
Round 1: model receives the full room image and selects 1-2 regions worth closer inspection, returning normalised bounding box coordinates and a reason for each. Round 2: model receives the original conversation plus cropped images of those regions, then gives a final cleanliness verdict.
**Note:** this adapter scores below the single-turn adapter (F1 0.736 vs 0.774) on the current synthetic dataset. The two-turn format gives the model more surface area to pick up spurious patterns from the guidance_scale=30 FLUX images. Use `lora_adapter` from this repo for better overall performance. This adapter is included as a reference for the agentic training approach.
## How to use
This adapter requires a two-turn inference loop. See `backend/agent.py` in the roomaudit repository for the full implementation.
```pythonfrom huggingface_hub import snapshot_downloadfrom unsloth import FastVisionModelfrom peft import PeftModel
# Download adaptersnapshot_download( "RanenSim/roomaudit-adapters", allow_patterns="lora_adapter_agent/*", local_dir="outputs/",)
# Loadmodel, tokenizer = FastVisionModel.from_pretrained( "unsloth/Qwen3-VL-4B-Instruct-unsloth-bnb-4bit", load_in_4bit=True,)model = PeftModel.from_pretrained(model, "outputs/lora_adapter_agent")FastVisionModel.for_inference(model)```
**Round 1 prompt** — sent with the full room image:```Before assessing this hotel room, identify 1-2 specific regions you want to inspect more closely.Choose regions that would give the most useful evidence about cleanliness:beds, pillows, floors, bins, towels, chairs are common inspection areas.Respond ONLY with this schema:{"regions": [{"region": [x1, y1, x2, y2], "reason": "..."}, ...]}where coordinates are fractions of the image size (0.0 to 1.0),x1,y1 is top-left and x2,y2 is bottom-right. Identify exactly 1 or 2 regions.```
**Round 2 prompt** — sent with the cropped region images appended to the Round 1 conversation:```Here are the regions you requested.Now give your final cleanliness assessment using only this schema:{"clean": true/false, "defects": [{"object": "...", "type": "...", "description": "..."}]}Valid objects: pillow, bed_sheet, blanket, floor, carpet, chair, desk, mirror, sofa, bath_towel, bin, window.Valid defect types: stain, hair, debris, litter, not_emptied, dirty.If no defects are visible in the inspected regions, set clean=true and defects=[].```
## Training data
Same dataset as `lora_adapter`: 218 clean images, 654 synthetic messy variants (SAM3 + FLUX.1 Fill, guidance_scale=30). Balanced 1:1 by repeating each clean image 3× with cycling preferred crop objects (`pillow → bed_sheet → floor → carpet → chair → bin → bath_towel`). Total: 1308 rows, 85/15 split.
Each training sample is a full two-turn conversation. Round 1 target: a JSON region list derived from SAM3 mask bounding boxes. Round 2 target: the ground-truth cleanliness verdict.
## Training config
| | ||---|---|| Base model | Qwen3-VL-4B-Instruct (4-bit QLoRA via Unsloth) || LoRA r / alpha | 32 / 32 || Target modules | attention + MLP (vision encoder frozen) || lora_dropout | 0.05 || Learning rate | 5e-5 (cosine, warmup 5%) || Batch size | 2 × grad_accum 4 = 8 effective || Epochs | 15 (early stopped at step 1225 ≈ epoch 8.8, patience=6) || Optimizer | AdamW 8-bit || Precision | bfloat16 || Hardware | RTX 5070 Ti, 16GB VRAM |
Best checkpoint: step 1075, eval_loss 0.051568
## Results
Evaluated on 196 held-out samples (15% split, balanced clean/messy).
| Metric | Score ||---|---|| Accuracy | 0.663 || Precision | 0.622 || Recall | 0.902 || F1 | 0.736 |
Confusion matrix: TN=38, FP=56, FN=10, TP=92. Clean room accuracy 40%.

## Limitations
- Scores below the single-turn adapter on every metric- 60% false positive rate on clean rooms — the model is heavily biased toward predicting messy- The two-turn format likely amplifies spurious patterns from the synthetic training data: the scout step creates an "inspecting closely → defect present" association that hurts clean room classification- Expected to improve with higher-quality inpainting data (guidance_scale=10)123456789101112131415161718192021222324252627282930313233343536373839404142{
"alora_invocation_tokens": null,
"alpha_pattern": {},
"arrow_config": null,
"auto_mapping": {
"base_model_class": "Qwen3VLForConditionalGeneration",
"parent_library": "transformers.models.qwen3_vl.modeling_qwen3_vl",
"unsloth_fixed": true
},
"base_model_name_or_path": "unsloth/Qwen3-VL-4B-Instruct-unsloth-bnb-4bit",
"bias": "none",
"corda_config": null,
"ensure_weight_tying": false,
"eva_config": null,
"exclude_modules": null,
"fan_in_fan_out": false,
"inference_mode": true,
"init_lora_weights": true,
"layer_replication": null,
"layers_pattern": null,
"layers_to_transform": null,
"loftq_config": {},
"lora_alpha": 32,
"lora_bias": false,
"lora_dropout": 0.05,
"megatron_config": null,
"megatron_core": "megatron.core",
"modules_to_save": null,
"peft_type": "LORA",
"peft_version": "0.18.1",
"qalora_group_size": 16,
"r": 32,
"rank_pattern": {},
"revision": null,
"target_modules": "(?:.*?(?:language|text).*?(?:self_attn|attention|attn|mlp|feed_forward|ffn|dense).*?(?:qkv|proj|linear_fc1|linear_fc2|q_proj|k_proj|v_proj|o_proj|gate_proj|up_proj|down_proj).*?)|(?:\\bmodel\\.layers\\.[\\d]{1,}\\.(?:self_attn|attention|attn|mlp|feed_forward|ffn|dense)\\.(?:(?:qkv|proj|linear_fc1|linear_fc2|q_proj|k_proj|v_proj|o_proj|gate_proj|up_proj|down_proj)))",
"target_parameters": null,
"task_type": "CAUSAL_LM",
"trainable_token_indices": null,
"use_dora": false,
"use_qalora": false,
"use_rslora": false
}123version https://git-lfs.github.com/spec/v1oid sha256:3bacfe84948e6e1baa5c10f602231f79ab50c6a14a8eac325b4e402c0a4a0cebsize 26431645612345678910111213141516171819202122232425262728{
"</think>": 151668,
"</tool_call>": 151658,
"</tool_response>": 151666,
"<think>": 151667,
"<tool_call>": 151657,
"<tool_response>": 151665,
"<|box_end|>": 151649,
"<|box_start|>": 151648,
"<|endoftext|>": 151643,
"<|file_sep|>": 151664,
"<|fim_middle|>": 151660,
"<|fim_pad|>": 151662,
"<|fim_prefix|>": 151659,
"<|fim_suffix|>": 151661,
"<|im_end|>": 151645,
"<|im_start|>": 151644,
"<|image_pad|>": 151655,
"<|object_ref_end|>": 151647,
"<|object_ref_start|>": 151646,
"<|quad_end|>": 151651,
"<|quad_start|>": 151650,
"<|repo_name|>": 151663,
"<|video_pad|>": 151656,
"<|vision_end|>": 151653,
"<|vision_pad|>": 151654,
"<|vision_start|>": 151652
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120{%- if tools %}
{{- '<|im_start|>system\n' }}
{%- if messages[0].role == 'system' %}
{%- if messages[0].content is string %}
{{- messages[0].content }}
{%- else %}
{%- for content in messages[0].content %}
{%- if 'text' in content %}
{{- content.text }}
{%- endif %}
{%- endfor %}
{%- endif %}
{{- '\n\n' }}
{%- endif %}
{{- "# 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>" }}
{%- for tool in tools %}
{{- "\n" }}
{{- tool | tojson }}
{%- endfor %}
{{- "\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" }}
{%- else %}
{%- if messages[0].role == 'system' %}
{{- '<|im_start|>system\n' }}
{%- if messages[0].content is string %}
{{- messages[0].content }}
{%- else %}
{%- for content in messages[0].content %}
{%- if 'text' in content %}
{{- content.text }}
{%- endif %}
{%- endfor %}
{%- endif %}
{{- '<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- set image_count = namespace(value=0) %}
{%- set video_count = namespace(value=0) %}
{%- for message in messages %}
{%- if message.role == "user" %}
{{- '<|im_start|>' + message.role + '\n' }}
{%- if message.content is string %}
{{- message.content }}
{%- else %}
{%- for content in message.content %}
{%- if content.type == 'image' or 'image' in content or 'image_url' in content %}
{%- set image_count.value = image_count.value + 1 %}
{%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}
<|vision_start|><|image_pad|><|vision_end|>
{%- elif content.type == 'video' or 'video' in content %}
{%- set video_count.value = video_count.value + 1 %}
{%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}
<|vision_start|><|video_pad|><|vision_end|>
{%- elif 'text' in content %}
{{- content.text }}
{%- endif %}
{%- endfor %}
{%- endif %}
{{- '<|im_end|>\n' }}
{%- elif message.role == "assistant" %}
{{- '<|im_start|>' + message.role + '\n' }}
{%- if message.content is string %}
{{- message.content }}
{%- else %}
{%- for content_item in message.content %}
{%- if 'text' in content_item %}
{{- content_item.text }}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- if message.tool_calls %}
{%- for tool_call in message.tool_calls %}
{%- if (loop.first and message.content) or (not loop.first) %}
{{- '\n' }}
{%- endif %}
{%- if tool_call.function %}
{%- set tool_call = tool_call.function %}
{%- endif %}
{{- '<tool_call>\n{"name": "' }}
{{- tool_call.name }}
{{- '", "arguments": ' }}
{%- if tool_call.arguments is string %}
{{- tool_call.arguments }}
{%- else %}
{{- tool_call.arguments | tojson }}
{%- endif %}
{{- '}\n</tool_call>' }}
{%- endfor %}
{%- endif %}
{{- '<|im_end|>\n' }}
{%- elif message.role == "tool" %}
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
{{- '<|im_start|>user' }}
{%- endif %}
{{- '\n<tool_response>\n' }}
{%- if message.content is string %}
{{- message.content }}
{%- else %}
{%- for content in message.content %}
{%- if content.type == 'image' or 'image' in content or 'image_url' in content %}
{%- set image_count.value = image_count.value + 1 %}
{%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}
<|vision_start|><|image_pad|><|vision_end|>
{%- elif content.type == 'video' or 'video' in content %}
{%- set video_count.value = video_count.value + 1 %}
{%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}
<|vision_start|><|video_pad|><|vision_end|>
{%- elif 'text' in content %}
{{- content.text }}
{%- endif %}
{%- endfor %}
{%- endif %}
{{- '\n</tool_response>' }}
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
{{- '<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '<|im_start|>assistant\n' }}
{%- endif %}1[0308/160212.853:ERROR:third_party\crashpad\crashpad\util\win\registration_protocol_win.cc:108] CreateFile: The system cannot find the file specified. (0x2)123456789101112131415161718192021222324252627282930313233343536373839{
"crop_size": null,
"data_format": "channels_first",
"default_to_square": true,
"device": null,
"disable_grouping": null,
"do_center_crop": null,
"do_convert_rgb": true,
"do_normalize": true,
"do_pad": null,
"do_rescale": true,
"do_resize": true,
"image_mean": [
0.5,
0.5,
0.5
],
"image_processor_type": "Qwen2VLImageProcessorFast",
"image_std": [
0.5,
0.5,
0.5
],
"input_data_format": null,
"max_pixels": null,
"merge_size": 2,
"min_pixels": null,
"pad_size": null,
"patch_size": 16,
"processor_class": "_Unsloth_Patched_Qwen3VLProcessor",
"resample": 3,
"rescale_factor": 0.00392156862745098,
"return_tensors": null,
"size": {
"longest_edge": 16777216,
"shortest_edge": 65536
},
"temporal_patch_size": 2
}12345678910111213141516171819202122232425262728293031{
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|object_ref_start|>",
"<|object_ref_end|>",
"<|box_start|>",
"<|box_end|>",
"<|quad_start|>",
"<|quad_end|>",
"<|vision_start|>",
"<|vision_end|>",
"<|vision_pad|>",
"<|image_pad|>",
"<|video_pad|>"
],
"eos_token": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|vision_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}123version https://git-lfs.github.com/spec/v1oid sha256:ef87fac7989717112d637f924bfeef777f7c04e5998979d47bcb9d2b03b74489size 11422922123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241{
"add_bos_token": false,
"add_prefix_space": false,
"added_tokens_decoder": {
"151643": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151644": {
"content": "<|im_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151645": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151646": {
"content": "<|object_ref_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151647": {
"content": "<|object_ref_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151648": {
"content": "<|box_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151649": {
"content": "<|box_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151650": {
"content": "<|quad_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151651": {
"content": "<|quad_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151652": {
"content": "<|vision_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151653": {
"content": "<|vision_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151654": {
"content": "<|vision_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151655": {
"content": "<|image_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151656": {
"content": "<|video_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151657": {
"content": "<tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151658": {
"content": "</tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151659": {
"content": "<|fim_prefix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151660": {
"content": "<|fim_middle|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151661": {
"content": "<|fim_suffix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151662": {
"content": "<|fim_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151663": {
"content": "<|repo_name|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151664": {
"content": "<|file_sep|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151665": {
"content": "<tool_response>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151666": {
"content": "</tool_response>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151667": {
"content": "<think>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151668": {
"content": "</think>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
}
},
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|object_ref_start|>",
"<|object_ref_end|>",
"<|box_start|>",
"<|box_end|>",
"<|quad_start|>",
"<|quad_end|>",
"<|vision_start|>",
"<|vision_end|>",
"<|vision_pad|>",
"<|image_pad|>",
"<|video_pad|>"
],
"bos_token": null,
"clean_up_tokenization_spaces": false,
"eos_token": "<|im_end|>",
"errors": "replace",
"extra_special_tokens": {},
"model_max_length": 262144,
"pad_token": "<|vision_pad|>",
"padding_side": "right",
"processor_class": "_Unsloth_Patched_Qwen3VLProcessor",
"split_special_tokens": false,
"tokenizer_class": "Qwen2Tokenizer",
"unk_token": null
}1234567891011121314151617181920212223242526272829303132333435363738394041{
"crop_size": null,
"data_format": "channels_first",
"default_to_square": true,
"device": null,
"do_center_crop": null,
"do_convert_rgb": true,
"do_normalize": true,
"do_rescale": true,
"do_resize": true,
"do_sample_frames": true,
"fps": 2,
"image_mean": [
0.5,
0.5,
0.5
],
"image_std": [
0.5,
0.5,
0.5
],
"input_data_format": null,
"max_frames": 768,
"merge_size": 2,
"min_frames": 4,
"num_frames": null,
"pad_size": null,
"patch_size": 16,
"processor_class": "_Unsloth_Patched_Qwen3VLProcessor",
"resample": 3,
"rescale_factor": 0.00392156862745098,
"return_metadata": false,
"size": {
"longest_edge": 25165824,
"shortest_edge": 4096
},
"temporal_patch_size": 2,
"video_metadata": null,
"video_processor_type": "Qwen3VLVideoProcessor"
}.gitattributes+1
lora_adapter_agent/README.mdAdded+117
lora_adapter_agent/adapter_config.jsonAdded+42
lora_adapter_agent/adapter_model.safetensorsAdded+3
lora_adapter_agent/added_tokens.jsonAdded+28
lora_adapter_agent/chat_template.jinjaAdded+120
lora_adapter_agent/debug.logAdded+1
lora_adapter_agent/merges.txtAdded
lora_adapter_agent/preprocessor_config.jsonAdded+39
lora_adapter_agent/special_tokens_map.jsonAdded+31
lora_adapter_agent/tokenizer.jsonAdded+3
lora_adapter_agent/tokenizer_config.jsonAdded+241
lora_adapter_agent/video_preprocessor_config.jsonAdded+41
lora_adapter_agent/vocab.jsonAdded