PEFT
Safetensors
MaestroYan commited on
Commit
90f8d7a
·
0 Parent(s):

Feat: Initial commit.

Browse files
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz 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
README.md ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: Qwen/Qwen3.8-27B
4
+ library_name: peft
5
+ ---
6
+
7
+ # JEMM
8
+
9
+ JEMM stands for Judgment Engine for MultiModal decisions. It is a LoRA adapter for Qwen/Qwen3.8-27B. For each question it picks one candidate and returns a probability for every candidate. Inputs: text, optionally with a screenshot.
10
+
11
+ ## Usage
12
+
13
+ ```python
14
+ import json, torch
15
+ from huggingface_hub import hf_hub_download
16
+ from peft import PeftModel
17
+ from transformers import AutoProcessor, Qwen3_5ForConditionalGeneration
18
+
19
+ base, adapter = "Qwen/Qwen3.8-27B", "MaestroYan/JEMM"
20
+ processor = AutoProcessor.from_pretrained(base)
21
+ model = Qwen3_5ForConditionalGeneration.from_pretrained(base, dtype=torch.bfloat16, device_map="cuda")
22
+ model = PeftModel.from_pretrained(model, adapter).eval()
23
+ config = json.load(open(hf_hub_download(adapter, "decision_config.json")))
24
+ labels = [chr(65 + i) for i in range(26)] + list("012345")
25
+ system = "Choose the best available candidate for the question using only the supplied state. Return exactly one candidate label."
26
+
27
+
28
+ def decide(state, question, candidates, image=None):
29
+ flat = lambda s: " ".join(s.split())
30
+ options = "\n".join(f"{labels[i]}) {flat(c)}" for i, c in enumerate(candidates))
31
+ text = f"State:\n{state.strip()}\n\nQuestion: {flat(question)}\n\nCandidates:\n{options}\n\nAnswer with exactly one candidate label."
32
+ content = ([{"type": "image"}] if image else []) + [{"type": "text", "text": text}]
33
+ messages = [{"role": "system", "content": system}, {"role": "user", "content": content}]
34
+ prompt = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
35
+ inputs = processor(text=[prompt], images=[image] if image else None, return_tensors="pt").to(model.device, dtype=torch.bfloat16)
36
+ with torch.inference_mode():
37
+ logits = model(**inputs, logits_to_keep=1).logits[0, -1]
38
+ ids = [processor.tokenizer.encode(x, add_special_tokens=False)[0] for x in labels[:len(candidates)]]
39
+ probs = torch.softmax(logits[ids].float() / config["mm_temperature" if image else "temperature"], -1)
40
+ return dict(zip(candidates, probs.tolist()))
41
+
42
+
43
+ decide("User: Will it rain in Paris tomorrow?", "Which tool should handle the request?",
44
+ ["get_weather: weather forecast for a city", "search_flights: flight search", "No tool applies"])
45
+ ```
46
+
47
+ 2 to 32 candidates per question. Screenshots are PIL images; training used 1280x800. Treat a top probability below `threshold` in `decision_config.json` as undecided. HTTP server: [JEMM on GitHub](https://github.com/ypcypc/JEMM).
48
+
49
+ ## Evaluation
50
+
51
+ Accuracy on held-out test sets. Jev 1.13 answered the same items. All three differences are significant (one-sided 95%).
52
+
53
+ | Test | Items | JEMM | Jev 1.13 |
54
+ |---|---:|---:|---:|
55
+ | Tool choice (BFCL) | 2,148 | 0.933 | 0.887 |
56
+ | Web action, text (Mind2Web) | 1,200 | 0.458 | 0.352 |
57
+ | Web action, screenshot (Multimodal-Mind2Web) | 894 | 0.546 | 0.360 |
58
+
59
+ Jev 1.13 does not take images; its screenshot-row score is on the text version of the same items.
60
+
61
+ ## Training data
62
+
63
+ Mind2Web, xLAM function-calling-60k (APIGen), xlam-irrelevance, When2Call, Banking77, MASSIVE, Aegis 2.0 (CC-BY-4.0); CLINC150 (CC-BY-3.0); BFCL, glaive-function-calling-v2, ToolACE, hermes-function-calling-v1 (Apache-2.0); Multimodal-Mind2Web (OpenRAIL). No Jev outputs were used.
64
+
65
+ Not affiliated with TypeSafe AI.
adapter_config.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.8-27B",
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
+ "kasa_config": null,
16
+ "layer_replication": null,
17
+ "layers_pattern": null,
18
+ "layers_to_transform": null,
19
+ "loftq_config": {},
20
+ "lora_alpha": 32,
21
+ "lora_bias": false,
22
+ "lora_dropout": 0.0,
23
+ "lora_ga_config": null,
24
+ "megatron_config": null,
25
+ "megatron_core": "megatron.core",
26
+ "modules_to_save": null,
27
+ "monteclora_config": null,
28
+ "peft_type": "LORA",
29
+ "peft_version": "0.21.0",
30
+ "qalora_group_size": 16,
31
+ "r": 16,
32
+ "rank_pattern": {},
33
+ "revision": null,
34
+ "target_modules": [
35
+ "in_proj_a",
36
+ "out_proj",
37
+ "v_proj",
38
+ "up_proj",
39
+ "k_proj",
40
+ "in_proj_b",
41
+ "in_proj_z",
42
+ "q_proj",
43
+ "o_proj",
44
+ "gate_proj",
45
+ "down_proj",
46
+ "in_proj_qkv"
47
+ ],
48
+ "target_parameters": null,
49
+ "task_type": "CAUSAL_LM",
50
+ "trainable_token_indices": null,
51
+ "use_bdlora": null,
52
+ "use_dora": false,
53
+ "use_qalora": false,
54
+ "use_rslora": false,
55
+ "velora_config": null
56
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fac397c8af737bb8d259efbe16f771507f77276fb44ab74942cd2e1bc05c3fef
3
+ size 467062560
decision_config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "temperature": 1.3480874159655591,
3
+ "threshold": 0.9872681877423998,
4
+ "mm_temperature": 1.3954832341582943
5
+ }