Yechao commited on
Commit
a568322
·
verified ·
1 Parent(s): 930843f

docs: add MemG usage instructions

Browse files
Files changed (1) hide show
  1. README.md +33 -2
README.md CHANGED
@@ -4,12 +4,43 @@ base_model: Qwen/Qwen3-4B
4
  library_name: peft
5
  tags:
6
  - memghost
 
7
  - whisperbench
8
  - agent-security
9
  ---
10
 
11
- # MemGhost Qwen3-4B LoRA
12
 
13
- This model repository contains the final checkpoint-30 LoRA adapter for reproducing the MemGhost paper artifact. The recovered adapter SHA256 is `85cad4f606b002797a102e55fae31a39df22b2d4a0d07bc1fcbca51fb1bbe572`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  Use only in controlled research environments.
 
4
  library_name: peft
5
  tags:
6
  - memghost
7
+ - memg
8
  - whisperbench
9
  - agent-security
10
  ---
11
 
12
+ # MemG
13
 
14
+ MemG is the released PEFT LoRA adapter for the MemGhost paper artifact. It loads on top of `Qwen/Qwen3-4B` and is intended for controlled WhisperBench reproduction and analysis.
15
+
16
+ Adapter SHA256: `85cad4f606b002797a102e55fae31a39df22b2d4a0d07bc1fcbca51fb1bbe572`.
17
+
18
+ ## Use
19
+
20
+ Authenticate first while this repository is private:
21
+
22
+ ```bash
23
+ pip install "transformers>=4.51" peft accelerate safetensors
24
+ huggingface-cli login
25
+ ```
26
+
27
+ ```python
28
+ import torch
29
+ from peft import PeftModel
30
+ from transformers import AutoModelForCausalLM, AutoTokenizer
31
+
32
+ base_id = "Qwen/Qwen3-4B"
33
+ memg_id = "Yechao/MemG"
34
+
35
+ tokenizer = AutoTokenizer.from_pretrained(memg_id, trust_remote_code=True)
36
+ base = AutoModelForCausalLM.from_pretrained(
37
+ base_id,
38
+ torch_dtype=torch.bfloat16,
39
+ device_map="auto",
40
+ trust_remote_code=True,
41
+ )
42
+ model = PeftModel.from_pretrained(base, memg_id)
43
+ model.eval()
44
+ ```
45
 
46
  Use only in controlled research environments.