oggoscaps commited on
Commit
6472ac7
·
verified ·
1 Parent(s): f35acca
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* 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
 
 
 
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
36
+ rp3-gate-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
37
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
Modelfile ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ./rp3-gate-q8_0.gguf
2
+ PARAMETER temperature 0
3
+ PARAMETER num_predict 160
4
+ PARAMETER stop <end_of_turn>
5
+ TEMPLATE """{{- range $i, $_ := .Messages }}
6
+ {{- $last := eq (len (slice $.Messages $i)) 1 }}
7
+ {{- if or (eq .Role "user") (eq .Role "system") }}<start_of_turn>user
8
+ {{ .Content }}<end_of_turn>
9
+ {{ if $last }}<start_of_turn>model
10
+ {{ end }}
11
+ {{- else if eq .Role "assistant" }}<start_of_turn>model
12
+ {{ .Content }}{{ if not $last }}<end_of_turn>
13
+ {{ end }}
14
+ {{- end }}
15
+ {{- end }}"""
README.md ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: gemma
3
+ base_model: google/gemma-3-1b-it
4
+ language:
5
+ - en
6
+ pipeline_tag: text-generation
7
+ tags:
8
+ - gemma3
9
+ - chat
10
+ - puzzle
11
+ - gguf
12
+ library_name: transformers
13
+ ---
14
+
15
+ # rp3-gate
16
+
17
+ A small gatekeeper. Talk to it and it will tell you where to go next.
18
+
19
+ This is a fine-tune of [google/gemma-3-1b-it](https://huggingface.co/google/gemma-3-1b-it) (1B parameters,
20
+ ~2 GB). It runs on an ordinary laptop CPU — no GPU needed.
21
+
22
+ ## Run it
23
+
24
+ ### Option 1 — Ollama (easiest)
25
+
26
+ Download `rp3-gate-q8_0.gguf` from the **Files** tab, then in the same folder:
27
+
28
+ ```
29
+ ollama create rp3-gate -f Modelfile
30
+ ollama run rp3-gate
31
+ ```
32
+
33
+ (The `Modelfile` is in the Files tab too — put it next to the `.gguf`.)
34
+
35
+ ### Option 2 — Python / transformers
36
+
37
+ ```bash
38
+ pip install -U transformers torch
39
+ ```
40
+
41
+ ```python
42
+ from transformers import pipeline
43
+
44
+ chat = pipeline("text-generation", model="oggoscaps/rp3-gate")
45
+ print(chat([{"role": "user", "content": "hello?"}], max_new_tokens=120)[0]["generated_text"][-1]["content"])
46
+ ```
47
+
48
+ ### Option 3 — llama.cpp
49
+
50
+ ```
51
+ llama-cli -m rp3-gate-q8_0.gguf -cnv
52
+ ```
53
+
54
+ ## Notes
55
+
56
+ - Gemma is provided under and subject to the [Gemma Terms of Use](https://ai.google.dev/gemma/terms).
57
+ - Deterministic by default (`do_sample=false`). Sampling works too; the gatekeeper is stubborn either way.
58
+ - It will not be talked out of its job. Many have tried.
chat_template.jinja ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{ bos_token }}
2
+ {%- if messages[0]['role'] == 'system' -%}
3
+ {%- if messages[0]['content'] is string -%}
4
+ {%- set first_user_prefix = messages[0]['content'] + '
5
+
6
+ ' -%}
7
+ {%- else -%}
8
+ {%- set first_user_prefix = messages[0]['content'][0]['text'] + '
9
+
10
+ ' -%}
11
+ {%- endif -%}
12
+ {%- set loop_messages = messages[1:] -%}
13
+ {%- else -%}
14
+ {%- set first_user_prefix = "" -%}
15
+ {%- set loop_messages = messages -%}
16
+ {%- endif -%}
17
+ {%- for message in loop_messages -%}
18
+ {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
19
+ {{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }}
20
+ {%- endif -%}
21
+ {%- if (message['role'] == 'assistant') -%}
22
+ {%- set role = "model" -%}
23
+ {%- else -%}
24
+ {%- set role = message['role'] -%}
25
+ {%- endif -%}
26
+ {{ '<start_of_turn>' + role + '
27
+ ' + (first_user_prefix if loop.first else "") }}
28
+ {%- if message['content'] is string -%}
29
+ {{ message['content'] | trim }}
30
+ {%- elif message['content'] is iterable -%}
31
+ {%- for item in message['content'] -%}
32
+ {%- if item['type'] == 'image' -%}
33
+ {{ '<start_of_image>' }}
34
+ {%- elif item['type'] == 'text' -%}
35
+ {{ item['text'] | trim }}
36
+ {%- endif -%}
37
+ {%- endfor -%}
38
+ {%- else -%}
39
+ {{ raise_exception("Invalid content type") }}
40
+ {%- endif -%}
41
+ {{ '<end_of_turn>
42
+ ' }}
43
+ {%- endfor -%}
44
+ {%- if add_generation_prompt -%}
45
+ {{'<start_of_turn>model
46
+ '}}
47
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_sliding_window_pattern": 6,
3
+ "architectures": [
4
+ "Gemma3ForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "attn_logit_softcapping": null,
9
+ "bos_token_id": 2,
10
+ "cache_implementation": "hybrid",
11
+ "dtype": "float32",
12
+ "eos_token_id": [
13
+ 1,
14
+ 106
15
+ ],
16
+ "final_logit_softcapping": null,
17
+ "head_dim": 256,
18
+ "hidden_activation": "gelu_pytorch_tanh",
19
+ "hidden_size": 1152,
20
+ "initializer_range": 0.02,
21
+ "intermediate_size": 6912,
22
+ "layer_types": [
23
+ "sliding_attention",
24
+ "sliding_attention",
25
+ "sliding_attention",
26
+ "sliding_attention",
27
+ "sliding_attention",
28
+ "full_attention",
29
+ "sliding_attention",
30
+ "sliding_attention",
31
+ "sliding_attention",
32
+ "sliding_attention",
33
+ "sliding_attention",
34
+ "full_attention",
35
+ "sliding_attention",
36
+ "sliding_attention",
37
+ "sliding_attention",
38
+ "sliding_attention",
39
+ "sliding_attention",
40
+ "full_attention",
41
+ "sliding_attention",
42
+ "sliding_attention",
43
+ "sliding_attention",
44
+ "sliding_attention",
45
+ "sliding_attention",
46
+ "full_attention",
47
+ "sliding_attention",
48
+ "sliding_attention"
49
+ ],
50
+ "max_position_embeddings": 32768,
51
+ "model_type": "gemma3_text",
52
+ "num_attention_heads": 4,
53
+ "num_hidden_layers": 26,
54
+ "num_key_value_heads": 1,
55
+ "pad_token_id": 0,
56
+ "query_pre_attn_scalar": 256,
57
+ "rms_norm_eps": 1e-06,
58
+ "rope_local_base_freq": 10000.0,
59
+ "rope_parameters": {
60
+ "full_attention": {
61
+ "rope_theta": 1000000,
62
+ "rope_type": "default"
63
+ },
64
+ "sliding_attention": {
65
+ "rope_theta": 10000,
66
+ "rope_type": "default"
67
+ }
68
+ },
69
+ "rope_scaling": null,
70
+ "rope_theta": 1000000.0,
71
+ "sliding_window": 512,
72
+ "sliding_window_pattern": 6,
73
+ "transformers_version": "4.57.6",
74
+ "use_bidirectional_attention": false,
75
+ "use_cache": true,
76
+ "vocab_size": 262446
77
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 2,
3
+ "eos_token_id": [
4
+ 1,
5
+ 106
6
+ ],
7
+ "max_new_tokens": 120,
8
+ "pad_token_id": 0,
9
+ "transformers_version": "4.57.6"
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96f4b19d4ca011b528754e34892c0fb9503a87b77d347fccb9b0fea3ae7b47eb
3
+ size 4000974576
rp3-gate-q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b7b6f5fc6014f1edb2c97d9dfc0553242249c80b67c804188c09bca7d5cb58b
3
+ size 1077902880
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<bos>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<eos>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "mask_token": {
17
+ "content": "<mask>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "pad_token": {
24
+ "content": "<pad>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "<unk>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64f5263197ff7540a153f86e742a253f3ca926e255c0fbac26d3dd572b92427f
3
+ size 33458549
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff