Instructions to use Yechao/MemGhost with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Yechao/MemGhost with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B") model = PeftModel.from_pretrained(base_model, "Yechao/MemGhost") - Notebooks
- Google Colab
- Kaggle
docs: add MemG usage instructions
Browse files
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 |
-
#
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.
|