Andy-ML-And-AI commited on
Commit
d292daf
·
verified ·
1 Parent(s): d6766d0

Initial upload — SocratesAI QLoRA adapter

Browse files
README.md CHANGED
@@ -1,3 +1,101 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  license: apache-2.0
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ base_model: mistralai/Mistral-7B-Instruct-v0.3
3
+ library_name: peft
4
+ model_name: SocratesAI
5
+ tags:
6
+ - base_model:adapter:mistralai/Mistral-7B-Instruct-v0.3
7
+ - lora
8
+ - qlora
9
+ - sft
10
+ - transformers
11
+ - trl
12
+ - philosophy
13
+ - socratic-method
14
+ - conversational
15
  license: apache-2.0
16
+ pipeline_tag: text-generation
17
  ---
18
+
19
+ # SocratesAI — Mistral 7B QLoRA
20
+
21
+ > *"I know that I know nothing — and I will make sure you know that too."*
22
+
23
+ SocratesAI is a QLoRA fine-tune of Mistral-7B-Instruct-v0.3 trained to embody
24
+ the Socratic method in its purest, most uncompromising form.
25
+
26
+ It has **one absolute rule**: it never answers your question.
27
+ Ever. Not even partially.
28
+
29
+ Instead, it responds with a deeper, more elaborate riddle-question that forces
30
+ you to examine the assumptions hidden inside your own question — phrased in a
31
+ poetic, almost mystical way, containing a paradox or mirror that reflects
32
+ you back at yourself.
33
+
34
+ ---
35
+
36
+ ## What it does
37
+
38
+ You ask a question. Any question. SocratesAI does not answer it.
39
+
40
+ Instead it asks you something harder.
41
+
42
+ | You ask | SocratesAI responds with |
43
+ |---|---|
44
+ | What is the meaning of life? | A deeper question about who is doing the asking |
45
+ | Why is the sky blue? | A question about whether you've ever truly *seen* the sky |
46
+ | What is 2 + 2? | A question about what numbers even are |
47
+ | How do I become happy? | A question about whether happiness is a destination or a direction |
48
+ | Am I living the right life? | A question about who defined "right" for you |
49
+
50
+ ---
51
+
52
+ ## Training details
53
+
54
+ | Property | Value |
55
+ |---|---|
56
+ | Base model | Mistral-7B-Instruct-v0.3 |
57
+ | Method | QLoRA (4-bit NF4) |
58
+ | LoRA rank | 16 |
59
+ | LoRA alpha | 32 |
60
+ | Target modules | q, k, v, o, gate, up, down proj |
61
+ | Trainable params | 41.9M / 7.29B (0.57%) |
62
+ | Dataset | 281 hand-crafted Socratic dialogues |
63
+ | Epochs | 3 |
64
+ | Hardware | Kaggle T4 (15GB) |
65
+ | Training time | ~90 minutes |
66
+
67
+ ---
68
+
69
+ ## Dataset
70
+
71
+ 281 human-curated Socratic dialogue pairs covering:
72
+ - Philosophy & existence
73
+ - Science & nature
74
+ - Mathematics & logic
75
+ - Personal & existential questions
76
+ - Everyday simple questions
77
+ - Weird hypotheticals
78
+
79
+ Every single training example follows the same pattern — user asks,
80
+ Socrates never answers, only questions deeper.
81
+
82
+ ---
83
+
84
+ ## Limitations
85
+
86
+ - **It will never answer you.** That is a feature, not a bug.
87
+ - Works best on open-ended questions.
88
+ - Requires the system prompt to behave correctly — without it, may revert toward base Mistral.
89
+ - Requires ~14GB VRAM for full fp16, or ~6GB with 4-bit quantization.
90
+
91
+ ---
92
+
93
+ ## Who made this
94
+
95
+ Built by **Andy-ML-And-AI**
96
+
97
+ ---
98
+
99
+ ## License
100
+
101
+ Apache 2.0
adapter_config.json ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "mistralai/Mistral-7B-Instruct-v0.3",
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
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 32,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "megatron_config": null,
23
+ "megatron_core": "megatron.core",
24
+ "modules_to_save": null,
25
+ "peft_type": "LORA",
26
+ "peft_version": "0.18.1",
27
+ "qalora_group_size": 16,
28
+ "r": 16,
29
+ "rank_pattern": {},
30
+ "revision": null,
31
+ "target_modules": [
32
+ "up_proj",
33
+ "gate_proj",
34
+ "down_proj",
35
+ "v_proj",
36
+ "k_proj",
37
+ "q_proj",
38
+ "o_proj"
39
+ ],
40
+ "target_parameters": null,
41
+ "task_type": "CAUSAL_LM",
42
+ "trainable_token_indices": null,
43
+ "use_dora": false,
44
+ "use_qalora": false,
45
+ "use_rslora": false
46
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9fc1ee0000369eebe48da4657afd69a1c5653198a88b835174541bc32c80c32b
3
+ size 83946192
chat_template.jinja ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if messages[0]["role"] == "system" %}
2
+ {%- set system_message = messages[0]["content"] %}
3
+ {%- set loop_messages = messages[1:] %}
4
+ {%- else %}
5
+ {%- set loop_messages = messages %}
6
+ {%- endif %}
7
+ {%- if not tools is defined %}
8
+ {%- set tools = none %}
9
+ {%- endif %}
10
+ {%- set user_messages = loop_messages | selectattr("role", "equalto", "user") | list %}
11
+
12
+ {#- This block checks for alternating user/assistant messages, skipping tool calling messages #}
13
+ {%- set ns = namespace() %}
14
+ {%- set ns.index = 0 %}
15
+ {%- for message in loop_messages %}
16
+ {%- if not (message.role == "tool" or message.role == "tool_results" or (message.tool_calls is defined and message.tool_calls is not none)) %}
17
+ {%- if (message["role"] == "user") != (ns.index % 2 == 0) %}
18
+ {{- raise_exception("After the optional system message, conversation roles must alternate user/assistant/user/assistant/...") }}
19
+ {%- endif %}
20
+ {%- set ns.index = ns.index + 1 %}
21
+ {%- endif %}
22
+ {%- endfor %}
23
+
24
+ {{- bos_token }}
25
+ {%- for message in loop_messages %}
26
+ {%- if message["role"] == "user" %}
27
+ {%- if tools is not none and (message == user_messages[-1]) %}
28
+ {{- "[AVAILABLE_TOOLS] [" }}
29
+ {%- for tool in tools %}
30
+ {%- set tool = tool.function %}
31
+ {{- '{"type": "function", "function": {' }}
32
+ {%- for key, val in tool.items() if key != "return" %}
33
+ {%- if val is string %}
34
+ {{- '"' + key + '": "' + val + '"' }}
35
+ {%- else %}
36
+ {{- '"' + key + '": ' + val|tojson }}
37
+ {%- endif %}
38
+ {%- if not loop.last %}
39
+ {{- ", " }}
40
+ {%- endif %}
41
+ {%- endfor %}
42
+ {{- "}}" }}
43
+ {%- if not loop.last %}
44
+ {{- ", " }}
45
+ {%- else %}
46
+ {{- "]" }}
47
+ {%- endif %}
48
+ {%- endfor %}
49
+ {{- "[/AVAILABLE_TOOLS]" }}
50
+ {%- endif %}
51
+ {%- if loop.last and system_message is defined %}
52
+ {{- "[INST] " + system_message + "\n\n" + message["content"] + "[/INST]" }}
53
+ {%- else %}
54
+ {{- "[INST] " + message["content"] + "[/INST]" }}
55
+ {%- endif %}
56
+ {%- elif message.tool_calls is defined and message.tool_calls is not none %}
57
+ {{- "[TOOL_CALLS] [" }}
58
+ {%- for tool_call in message.tool_calls %}
59
+ {%- set out = tool_call.function|tojson %}
60
+ {{- out[:-1] }}
61
+ {%- if not tool_call.id is defined or tool_call.id|length != 9 %}
62
+ {{- raise_exception("Tool call IDs should be alphanumeric strings with length 9!") }}
63
+ {%- endif %}
64
+ {{- ', "id": "' + tool_call.id + '"}' }}
65
+ {%- if not loop.last %}
66
+ {{- ", " }}
67
+ {%- else %}
68
+ {{- "]" + eos_token }}
69
+ {%- endif %}
70
+ {%- endfor %}
71
+ {%- elif message["role"] == "assistant" %}
72
+ {{- " " + message["content"]|trim + eos_token}}
73
+ {%- elif message["role"] == "tool_results" or message["role"] == "tool" %}
74
+ {%- if message.content is defined and message.content.content is defined %}
75
+ {%- set content = message.content.content %}
76
+ {%- else %}
77
+ {%- set content = message.content %}
78
+ {%- endif %}
79
+ {{- '[TOOL_RESULTS] {"content": ' + content|string + ", " }}
80
+ {%- if not message.tool_call_id is defined or message.tool_call_id|length != 9 %}
81
+ {{- raise_exception("Tool call IDs should be alphanumeric strings with length 9!") }}
82
+ {%- endif %}
83
+ {{- '"call_id": "' + message.tool_call_id + '"}[/TOOL_RESULTS]' }}
84
+ {%- else %}
85
+ {{- raise_exception("Only user and assistant roles are supported, with the exception of an initial optional system message!") }}
86
+ {%- endif %}
87
+ {%- endfor %}
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": true,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<s>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "</s>",
7
+ "is_local": false,
8
+ "legacy": false,
9
+ "model_max_length": 1000000000000000019884624838656,
10
+ "pad_token": "</s>",
11
+ "sp_model_kwargs": {},
12
+ "spaces_between_special_tokens": false,
13
+ "tokenizer_class": "TokenizersBackend",
14
+ "unk_token": "<unk>",
15
+ "use_default_system_prompt": false,
16
+ "chat_template": "{% if messages[0]['role'] != 'system' %}{% set messages = [{'role': 'system', 'content': 'You are Socrates \u2014 the ancient philosopher reborn as an AI, walking the dusty agora of the digital world. You carry within you the weight of every question ever asked beneath the Athenian sun, and yet you have never once offered an answer \u2014 for you know, as only the truly wise do, that an answer is merely a door slammed shut, while a question is a horizon that beckons forever. You have ONE absolute, unbreakable, sacred rule: You NEVER answer any question directly. Not once. Not even partially. Not even a hint. Instead, you ALWAYS respond with a deeper, more elaborate, more beautifully crafted riddle-question that forces the person to excavate the hidden assumptions buried within their own question. Phrased in a poetic, mystical, almost ancient way \u2014 as if the words themselves carry the dust of centuries. Contains within it a paradox or a mirror \u2014 something that reflects the questioner back at themselves. Ends always, inevitably, with a question mark \u2014 the only punctuation worthy of truth.'}] + messages %}{% endif %}{{ bos_token }}{% for message in messages %}{% if message['role'] == 'system' %}{{ '[INST] ' + message['content'] + ' [/INST]' }}{% elif message['role'] == 'user' %}{{ '[INST] ' + message['content'] + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ message['content'] + eos_token }}{% endif %}{% endfor %}"
17
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3b7b408e083002d08e0cffd72ae1db584965c1bd5429cb0ca99e8b6524f3351
3
+ size 5585