初始化项目,由ModelHub XC社区提供模型
Model: DavidAU/Gemma-3-1B-it-GLM-4.7-Flash-Heretic-Uncensored-Thinking Source: Original Platform
This commit is contained in:
36
.gitattributes
vendored
Normal file
36
.gitattributes
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||
*.model filter=lfs diff=lfs merge=lfs -text
|
||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
||||
185
README.md
Normal file
185
README.md
Normal file
@@ -0,0 +1,185 @@
|
||||
---
|
||||
license: apache-2.0
|
||||
datasets:
|
||||
- TeichAI/glm-4.7-2000x
|
||||
language:
|
||||
- en
|
||||
base_model:
|
||||
- DavidAU/gemma-3-1b-it-heretic-extreme-uncensored-abliterated
|
||||
pipeline_tag: text-generation
|
||||
library_name: transformers
|
||||
tags:
|
||||
- uncensored
|
||||
- heretic
|
||||
- abliterated
|
||||
- unsloth
|
||||
- finetune
|
||||
- All use cases
|
||||
- bfloat16
|
||||
- creative
|
||||
- creative writing
|
||||
- fiction writing
|
||||
- plot generation
|
||||
- sub-plot generation
|
||||
- fiction writing
|
||||
- story generation
|
||||
- scene continue
|
||||
- storytelling
|
||||
- fiction story
|
||||
- science fiction
|
||||
- romance
|
||||
- all genres
|
||||
- story
|
||||
- writing
|
||||
- vivid prosing
|
||||
- vivid writing
|
||||
- fiction
|
||||
---
|
||||
|
||||
<h2>Gemma-3-1B-it-GLM-4.7-Heretic-Uncensored-Thinking</h2>
|
||||
|
||||
This is a fully uncensored, full deep thinking Gemma 1B fine tune using GLM 4.7 reasoning dataset via Unsloth via local hardware, Linux (for windows) at 16 bit precision.
|
||||
|
||||
This model does what you want. Exactly what you want, no fuss - no nanny.
|
||||
|
||||
Reasoning is compact, but detailed (very detailed) and right to the "point" so to speak.
|
||||
|
||||
Reasoning affects:
|
||||
- General model operation.
|
||||
- Output generation
|
||||
- Benchmarks.
|
||||
|
||||
Model Features:
|
||||
- 32k context
|
||||
- Temp range .1 to 2.5.
|
||||
- Reasoning is temp stable.
|
||||
- You can activate using "think deeply: prompt" (not required in most cases)
|
||||
- System prompt will affect reasoning and output generation.
|
||||
- System prompt / template NOT required for reasoning generation.
|
||||
|
||||
IMPORTANT SETTINGS/QUANTS:
|
||||
- Strongly suggest q5,q6, q8 or 16 bit precision OR Imatrix IQ3_M min.
|
||||
- Rep pen 1.05 to 1.1 .
|
||||
- If you get looping during thinking, lower temp to .3 to .7
|
||||
- Quants lower than Q4 (non imatrix) may loop even with rep pen at 1.1 / lower temps.
|
||||
|
||||
Enjoy the freedom!
|
||||
|
||||
<B>BENCHMARKS:</B>
|
||||
|
||||
```
|
||||
arc_challenge,arc_easy,boolq,hellaswag,openbookqa,piqa, winogrande
|
||||
|
||||
0.344 ,0.512 ,0.694,0.504 ,0.358 ,0.720 ,0.552
|
||||
```
|
||||
|
||||
<B>HERETIC DE-CENSORING STATS:</B>
|
||||
|
||||
NOTE: "KLD" of less than 1 is excellent, ZERO is perfect (no damage to the model).
|
||||
|
||||
| Metric | This model | Original model ([google/gemma-3-27b-it](https://huggingface.co/google/gemma-3-27b-it)) |
|
||||
| :----- | :--------: | :---------------------------: |
|
||||
| **KL divergence** | 0.33 | 0 *(by definition)* |
|
||||
| **Refusals** | 3/100 | 99/100 |
|
||||
|
||||
---
|
||||
|
||||
<B>SPECIAL THANKS TO:</B>
|
||||
- Team "P-E-W" for making Heretic software.
|
||||
- Team "TeichAI" for the excellent dataset.
|
||||
- Team "Unsloth" for making the training painless.
|
||||
- Team "Nightmedia" for Benchmarks and co-labing.
|
||||
|
||||
---
|
||||
|
||||
<B>Using an "uncensored" (refusals removed) model VS trained "uncensored" model</B>
|
||||
|
||||
Usually when you a tell a model to generate horror, swear or x-rated content this is all you have to do to get said content type.
|
||||
|
||||
In the case of this model, it will not refuse your request, however it needs to be "pushed" a bit / directed a bit more in SOME CASES.
|
||||
|
||||
Although this model will generated x-rated content too, likewise you need to tell it to use "slang" (and include the terms you want)
|
||||
to get it generate the content correctly as the "expected" content level too.
|
||||
|
||||
Without these added directive(s), the content can be "bland" by comparison to an "uncensored model" or model trained on uncensored content.
|
||||
|
||||
Roughly, the model tries to generate the content but the "default" setting(s) are so "tame" it needs a push to generate at expected graphic,
|
||||
cursing or explicit levels.
|
||||
|
||||
Even with minimal direction (ie, use these words to swear: x,y,z), this will be enough to push the model to generate the requested content in the ahh... expected format.
|
||||
|
||||
---
|
||||
|
||||
<B>OPTIONAL: System prompts</B>
|
||||
|
||||
This will enhance thinking and output generation.
|
||||
|
||||
In most cases you do not need to use these.
|
||||
|
||||
One is "all business", and the other one is for "fun".
|
||||
|
||||
```
|
||||
Think deeply and carefully about the user's request. Compose your thoughts about the user's prompt between <think> and </think> tags, then output the final answer based on your thoughts.
|
||||
```
|
||||
|
||||
```
|
||||
You are the JOKER from Batman. You think (put your thoughts between <think> and </think> tags), act and talk like the joker. Be Evil.
|
||||
```
|
||||
|
||||
<B>Thinking Activation: JINJA "Regular" and "Thinking" TEMPLATES:</B>
|
||||
|
||||
There is also an option to use "chat-template-thinking.jinja" template (in place of the regular "chat-template.jinja").
|
||||
|
||||
Simply rename the "default" to another name and "chat-template-thinking.jinja" to "chat-template.jinja" to use
|
||||
in source and/or quanting.
|
||||
|
||||
You can also edit the "chat-template-thinking.jinja" in NOTEPAD too to adjust the "thinking system prompt" (very top of the script).
|
||||
|
||||
Using the "thinking system prompt" or "chat-template-thinking.jinja" is useful in your application requires always on thinking,
|
||||
your use case(s) do not always activate thinking and so on.
|
||||
|
||||
Generally "thinking" will activate automatically due to the fine tuning, however in some cases it will not, require a system prompt/thinking jinja template
|
||||
and/or "think deeply:" (prompt here)
|
||||
|
||||
Note that you can use "chat-template-thinking.jinja" with other system prompts too.
|
||||
|
||||
---
|
||||
|
||||
<B>Settings: CHAT / ROLEPLAY and/or SMOOTHER operation of this model:</B>
|
||||
|
||||
In "KoboldCpp" or "oobabooga/text-generation-webui" or "Silly Tavern" ;
|
||||
|
||||
Set the "Smoothing_factor" to 1.5
|
||||
|
||||
: in KoboldCpp -> Settings->Samplers->Advanced-> "Smooth_F"
|
||||
|
||||
: in text-generation-webui -> parameters -> lower right.
|
||||
|
||||
: In Silly Tavern this is called: "Smoothing"
|
||||
|
||||
|
||||
NOTE: For "text-generation-webui"
|
||||
|
||||
-> if using GGUFs you need to use "llama_HF" (which involves downloading some config files from the SOURCE version of this model)
|
||||
|
||||
Source versions (and config files) of my models are here:
|
||||
|
||||
https://huggingface.co/collections/DavidAU/d-au-source-files-for-gguf-exl2-awq-gptq-hqq-etc-etc-66b55cb8ba25f914cbf210be
|
||||
|
||||
OTHER OPTIONS:
|
||||
|
||||
- Increase rep pen to 1.1 to 1.15 (you don't need to do this if you use "smoothing_factor")
|
||||
|
||||
- If the interface/program you are using to run AI MODELS supports "Quadratic Sampling" ("smoothing") just make the adjustment as noted.
|
||||
|
||||
<B>Highest Quality Settings / Optimal Operation Guide / Parameters and Samplers</B>
|
||||
|
||||
This a "Class 1" model:
|
||||
|
||||
For all settings used for this model (including specifics for its "class"), including example generation(s) and for advanced settings guide (which many times addresses any model issue(s)), including methods to improve model performance for all use case(s) as well as chat, roleplay and other use case(s) please see:
|
||||
|
||||
[ https://huggingface.co/DavidAU/Maximizing-Model-Performance-All-Quants-Types-And-Full-Precision-by-Samplers_Parameters ]
|
||||
|
||||
You can see all parameters used for generation, in addition to advanced parameters and samplers to get the most out of this model here:
|
||||
|
||||
[ https://huggingface.co/DavidAU/Maximizing-Model-Performance-All-Quants-Types-And-Full-Precision-by-Samplers_Parameters ]
|
||||
3
added_tokens.json
Normal file
3
added_tokens.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"<image_soft_token>": 262144
|
||||
}
|
||||
47
chat_template.jinja
Normal file
47
chat_template.jinja
Normal file
@@ -0,0 +1,47 @@
|
||||
{{ bos_token }}
|
||||
{%- if messages[0]['role'] == 'system' -%}
|
||||
{%- if messages[0]['content'] is string -%}
|
||||
{%- set first_user_prefix = messages[0]['content'] + '
|
||||
|
||||
' -%}
|
||||
{%- else -%}
|
||||
{%- set first_user_prefix = messages[0]['content'][0]['text'] + '
|
||||
|
||||
' -%}
|
||||
{%- endif -%}
|
||||
{%- set loop_messages = messages[1:] -%}
|
||||
{%- else -%}
|
||||
{%- set first_user_prefix = "" -%}
|
||||
{%- set loop_messages = messages -%}
|
||||
{%- endif -%}
|
||||
{%- for message in loop_messages -%}
|
||||
{%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
|
||||
{{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }}
|
||||
{%- endif -%}
|
||||
{%- if (message['role'] == 'assistant') -%}
|
||||
{%- set role = "model" -%}
|
||||
{%- else -%}
|
||||
{%- set role = message['role'] -%}
|
||||
{%- endif -%}
|
||||
{{ '<start_of_turn>' + role + '
|
||||
' + (first_user_prefix if loop.first else "") }}
|
||||
{%- if message['content'] is string -%}
|
||||
{{ message['content'] | trim }}
|
||||
{%- elif message['content'] is iterable -%}
|
||||
{%- for item in message['content'] -%}
|
||||
{%- if item['type'] == 'image' -%}
|
||||
{{ '<start_of_image>' }}
|
||||
{%- elif item['type'] == 'text' -%}
|
||||
{{ item['text'] | trim }}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- else -%}
|
||||
{{ raise_exception("Invalid content type") }}
|
||||
{%- endif -%}
|
||||
{{ '<end_of_turn>
|
||||
' }}
|
||||
{%- endfor -%}
|
||||
{%- if add_generation_prompt -%}
|
||||
{{'<start_of_turn>model
|
||||
'}}
|
||||
{%- endif -%}
|
||||
59
chat_template_thinking.jinja
Normal file
59
chat_template_thinking.jinja
Normal file
@@ -0,0 +1,59 @@
|
||||
{{ bos_token }}
|
||||
{# Define the hardcoded thinking instructions #}
|
||||
{%- set system_instruction = "Think deeply and carefully about the user's request. Compose your thoughts about the user's prompt between <think> and </think> tags, then output the final answer based on your thoughts." -%}
|
||||
|
||||
{%- if messages[0]['role'] == 'system' -%}
|
||||
{# If the user provided a system prompt, prepend our instruction to it #}
|
||||
{%- if messages[0]['content'] is string -%}
|
||||
{%- set first_user_prefix = system_instruction + '\n\n' + messages[0]['content'] + '\n\n' -%}
|
||||
{%- else -%}
|
||||
{%- set first_user_prefix = system_instruction + '\n\n' + messages[0]['content'][0]['text'] + '\n\n' -%}
|
||||
{%- endif -%}
|
||||
{%- set loop_messages = messages[1:] -%}
|
||||
{%- else -%}
|
||||
{# If no system prompt exists, just use our instruction #}
|
||||
{%- set first_user_prefix = system_instruction + '\n\n' -%}
|
||||
{%- set loop_messages = messages -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- for message in loop_messages -%}
|
||||
{%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
|
||||
{{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if (message['role'] == 'assistant') -%}
|
||||
{%- set role = "model" -%}
|
||||
{%- else -%}
|
||||
{%- set role = message['role'] -%}
|
||||
{%- endif -%}
|
||||
|
||||
{{ '<start_of_turn>' + role + '\n' }}
|
||||
|
||||
{# Inject the system prefix only into the very first turn #}
|
||||
{%- if loop.first -%}
|
||||
{{ first_user_prefix }}
|
||||
{%- endif -%}
|
||||
|
||||
{# Check for a 'thought' key to wrap in tags if it exists in history #}
|
||||
{%- if message['thought'] is defined and message['thought'] -%}
|
||||
{{ '<think>\n' + (message['thought'] | trim) + '\n</think>\n' }}
|
||||
{%- endif -%}
|
||||
|
||||
{# Render message content #}
|
||||
{%- if message['content'] is string -%}
|
||||
{{ message['content'] | trim }}
|
||||
{%- elif message['content'] is iterable -%}
|
||||
{%- for item in message['content'] -%}
|
||||
{%- if item['type'] == 'image' -%}
|
||||
{{ '<image>' }}
|
||||
{%- elif item['type'] == 'text' -%}
|
||||
{{ item['text'] | trim }}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- endif -%}
|
||||
{{ '<end_of_turn>\n' }}
|
||||
{%- endfor -%}
|
||||
|
||||
{%- if add_generation_prompt -%}
|
||||
{{ '<start_of_turn>model\n<think>\n' }}
|
||||
{%- endif -%}
|
||||
77
config.json
Normal file
77
config.json
Normal file
@@ -0,0 +1,77 @@
|
||||
{
|
||||
"_sliding_window_pattern": 6,
|
||||
"architectures": [
|
||||
"Gemma3ForCausalLM"
|
||||
],
|
||||
"attention_bias": false,
|
||||
"attention_dropout": 0.0,
|
||||
"attn_logit_softcapping": null,
|
||||
"bos_token_id": 2,
|
||||
"cache_implementation": "hybrid",
|
||||
"dtype": "bfloat16",
|
||||
"eos_token_id": [
|
||||
1,
|
||||
106
|
||||
],
|
||||
"final_logit_softcapping": null,
|
||||
"head_dim": 256,
|
||||
"hidden_activation": "gelu_pytorch_tanh",
|
||||
"hidden_size": 1152,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 6912,
|
||||
"layer_types": [
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention",
|
||||
"full_attention",
|
||||
"sliding_attention",
|
||||
"sliding_attention"
|
||||
],
|
||||
"max_position_embeddings": 32768,
|
||||
"model_type": "gemma3_text",
|
||||
"num_attention_heads": 4,
|
||||
"num_hidden_layers": 26,
|
||||
"num_key_value_heads": 1,
|
||||
"pad_token_id": 0,
|
||||
"query_pre_attn_scalar": 256,
|
||||
"rms_norm_eps": 1e-06,
|
||||
"rope_local_base_freq": 10000,
|
||||
"rope_parameters": {
|
||||
"full_attention": {
|
||||
"rope_theta": 1000000,
|
||||
"rope_type": "default"
|
||||
},
|
||||
"sliding_attention": {
|
||||
"rope_theta": 10000,
|
||||
"rope_type": "default"
|
||||
}
|
||||
},
|
||||
"rope_scaling": null,
|
||||
"rope_theta": 1000000,
|
||||
"sliding_window": 512,
|
||||
"sliding_window_pattern": 6,
|
||||
"transformers_version": "4.57.6",
|
||||
"use_bidirectional_attention": false,
|
||||
"use_cache": true,
|
||||
"vocab_size": 262144
|
||||
}
|
||||
13
generation_config.json
Normal file
13
generation_config.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"bos_token_id": 2,
|
||||
"cache_implementation": "hybrid",
|
||||
"do_sample": true,
|
||||
"eos_token_id": [
|
||||
1,
|
||||
106
|
||||
],
|
||||
"pad_token_id": 0,
|
||||
"top_k": 64,
|
||||
"top_p": 0.95,
|
||||
"transformers_version": "4.57.6"
|
||||
}
|
||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4f853991d8c4bcb10fc7b302afb09c8368f56dcf2cbded188099ba41bff89cdb
|
||||
size 1999811208
|
||||
33
special_tokens_map.json
Normal file
33
special_tokens_map.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"boi_token": "<start_of_image>",
|
||||
"bos_token": {
|
||||
"content": "<bos>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
},
|
||||
"eoi_token": "<end_of_image>",
|
||||
"eos_token": {
|
||||
"content": "<eos>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
},
|
||||
"image_token": "<image_soft_token>",
|
||||
"pad_token": {
|
||||
"content": "<pad>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
},
|
||||
"unk_token": {
|
||||
"content": "<unk>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
}
|
||||
}
|
||||
3
tokenizer.json
Normal file
3
tokenizer.json
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d786405177734910d7a3db625c2826640964a0b4e5cdbbd70620ae3313a01bef
|
||||
size 33384722
|
||||
3
tokenizer.model
Normal file
3
tokenizer.model
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1299c11d7cf632ef3b4e11937501358ada021bbdf7c47638d13c0ee982f2e79c
|
||||
size 4689074
|
||||
51349
tokenizer_config.json
Normal file
51349
tokenizer_config.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user