File size: 2,550 Bytes
133fed8
629e5bb
 
569d35c
629e5bb
569d35c
 
 
 
 
 
 
 
133fed8
629e5bb
569d35c
629e5bb
569d35c
629e5bb
569d35c
629e5bb
 
 
 
 
569d35c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
629e5bb
569d35c
629e5bb
569d35c
629e5bb
569d35c
 
 
629e5bb
569d35c
 
629e5bb
569d35c
 
 
629e5bb
569d35c
 
 
 
 
 
 
 
 
629e5bb
569d35c
629e5bb
 
 
569d35c
629e5bb
569d35c
629e5bb
569d35c
629e5bb
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
base_model: openai/gpt-oss-20b
library_name: peft
license: apache-2.0
tags:
  - lora
  - peft
  - safetensors
  - transformers
  - conversational
  - text-generation
language:
  - en
---

# SpaceLLM Multi Turn — LoRA Adapter for Multi-Turn Conversational Chat

SpaceLLM Multi Turn is a parameter-efficient LoRA adapter fine-tuned on top of [openai/gpt-oss-20b](https://huggingface.co/openai/gpt-oss-20b) for multi-turn conversational chat. Only the attention projection layers (`q_proj`, `k_proj`, `v_proj`, `o_proj`) are trained; the full transformer backbone remains frozen, keeping the adapter extremely lightweight while steering the model's outputs toward coherent, context-aware responses across extended conversations.

---

## Model Details

### Model Description

- **Developed by:** AdityaPS
- **Model type:** LoRA adapter (PEFT) over a causal language model
- **Base model:** [openai/gpt-oss-20b](https://huggingface.co/openai/gpt-oss-20b) (22B params, BF16/MXFP4)
- **Language(s):** English
- **License:** Apache 2.0
- **Task:** Causal LM / multi-turn conversational chat

### Adapter Configuration

| Parameter | Value |
|---|---|
| PEFT type | LoRA |
| Rank (`r`) | 16 |
| Alpha | 32 |
| Dropout | 0.05 |
| Target modules | `q_proj`, `k_proj`, `v_proj`, `o_proj` |
| Bias | none |
| Task type | CAUSAL_LM |
| PEFT version | 0.19.1 |

---

## How to Get Started

```python
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_model_id = "openai/gpt-oss-20b"
adapter_id = "AdityaPS/SpaceLLM_Multi_turn"

tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base_model = AutoModelForCausalLM.from_pretrained(base_model_id, device_map="auto")
model = PeftModel.from_pretrained(base_model, adapter_id)

messages = [
    {"role": "user", "content": "Hi, can you help me plan a trip?"},
    {"role": "assistant", "content": "Of course! Where are you thinking of going?"},
    {"role": "user", "content": "Somewhere in Japan, maybe Tokyo."},
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```

---

## Training Details

This adapter was trained using LoRA on the attention projection layers only, keeping the base model frozen. This makes the adapter lightweight to store and share while adapting the model's behavior for multi-turn, context-aware conversational chat.

---

## Framework Versions

- PEFT 0.19.1