gghfez commited on
Commit
7249c76
·
verified ·
1 Parent(s): 3a67b6b

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ 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
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: gemma
3
+ language:
4
+ - en
5
+ base_model:
6
+ - google/gemma-3-270m
7
+ tags:
8
+ - text-generation-inference
9
+ - transformers
10
+ - title-generation
11
+ - chat-summarization
12
+ - openwebui
13
+ - sft
14
+ - trl
15
+ - gemma3
16
+ pipeline_tag: text-generation
17
+ datasets:
18
+ - gghfez/openwebui_title_generation
19
+ ---
20
+
21
+ # OpenWebUI Title Generator - Gemma 270M
22
+
23
+ A fine-tuned Gemma 270M model specialized for generating concise, emoji-enhanced titles for chat conversations.
24
+ Use this to avoid wasting API credits or wiping out the llama.cpp KV cache after the first message.
25
+
26
+ ## Model Description
27
+
28
+ This model was fine-tuned on 8,900 examples of chat conversation title generation tasks. It takes chat history as input and outputs a JSON-formatted title with 3-5 words and relevant emojis.
29
+
30
+ ## Intended Use
31
+
32
+ - Generate titles for chat conversations in OpenWebUI
33
+ - Summarize conversation themes quickly
34
+ - Create engaging, emoji-enhanced titles
35
+
36
+
37
+ ## Performance
38
+
39
+ - Fast inference suitable for real-time title generation
40
+ - Lightweight at 270M parameters
41
+ - Consistent JSON output format
42
+
43
+
44
+ ## Usage
45
+
46
+ Set this as the "Task Model" in OpenWebUI.
47
+
48
+ Settings -> Admin -> Interface
49
+
50
+ ## Prompt format
51
+
52
+ The default OpenWebUI prompt format:
53
+
54
+ ```
55
+ ### Task:
56
+ Generate a concise, 3-5 word title with an emoji summarizing the chat history.
57
+ ### Guidelines:
58
+ - The title should clearly represent the main theme or subject of the conversation.
59
+ - Use emojis that enhance understanding of the topic, but avoid quotation marks or special formatting.
60
+ - Write the title in the chat's primary language; default to English if multilingual.
61
+ - Prioritize accuracy over excessive creativity; keep it clear and simple.
62
+ ### Output:
63
+ JSON format: { "title": "your concise title here" }
64
+ ### Examples:
65
+ - { "title": "📉 Stock Market Trends" },
66
+ - { "title": "🍪 Perfect Chocolate Chip Recipe" },
67
+ - { "title": "Evolution of Music Streaming" },
68
+ - { "title": "Remote Work Productivity Tips" },
69
+ - { "title": "Artificial Intelligence in Healthcare" },
70
+ - { "title": "🎮 Video Game Development Insights" }
71
+ ### Chat History:
72
+ <chat_history>
73
+ USER: hi
74
+ ASSISTANT: Hello! How can I assist you today? 😊
75
+ USER: who are you?
76
+ ASSISTANT: I’m Gemma, a large language model created by the Gemma team at Google DeepMind. I’m an open-weights model, which means I’m widely available for public use!
77
+ </chat_history>
78
+ ```
79
+
80
+ Expected response:
81
+
82
+ ```
83
+ '{"title": "👋 Simple Greeting"}'
84
+ ```
85
+
86
+ ## Limitations
87
+
88
+ - Optimized specifically for title generation in OpenWebUI
89
+ - May not perform well in other chat interfaces
90
+ - Emojis sometimes not placed consistently or may be omitted entirely
91
+ - Only tested at BF16
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "<image_soft_token>": 262144
3
+ }
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,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "eos_token_id": 1,
11
+ "final_logit_softcapping": null,
12
+ "head_dim": 256,
13
+ "hidden_activation": "gelu_pytorch_tanh",
14
+ "hidden_size": 640,
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 2048,
17
+ "layer_types": [
18
+ "sliding_attention",
19
+ "sliding_attention",
20
+ "sliding_attention",
21
+ "sliding_attention",
22
+ "sliding_attention",
23
+ "full_attention",
24
+ "sliding_attention",
25
+ "sliding_attention",
26
+ "sliding_attention",
27
+ "sliding_attention",
28
+ "sliding_attention",
29
+ "full_attention",
30
+ "sliding_attention",
31
+ "sliding_attention",
32
+ "sliding_attention",
33
+ "sliding_attention",
34
+ "sliding_attention",
35
+ "full_attention"
36
+ ],
37
+ "max_position_embeddings": 32768,
38
+ "model_type": "gemma3_text",
39
+ "num_attention_heads": 4,
40
+ "num_hidden_layers": 18,
41
+ "num_key_value_heads": 1,
42
+ "pad_token_id": 0,
43
+ "query_pre_attn_scalar": 256,
44
+ "rms_norm_eps": 1e-06,
45
+ "rope_local_base_freq": 10000.0,
46
+ "rope_scaling": null,
47
+ "rope_theta": 1000000.0,
48
+ "sliding_window": 512,
49
+ "torch_dtype": "bfloat16",
50
+ "transformers_version": "4.55.4",
51
+ "use_bidirectional_attention": false,
52
+ "use_cache": true,
53
+ "vocab_size": 262144
54
+ }
generation_config.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 2,
3
+ "cache_implementation": "hybrid",
4
+ "do_sample": true,
5
+ "eos_token_id": 1,
6
+ "max_length": 32768,
7
+ "pad_token_id": 0,
8
+ "top_k": 64,
9
+ "top_p": 0.95,
10
+ "transformers_version": "4.55.4"
11
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:00c2a8ace3536fba54cfd520c09b949aa5b273c4ac07049996d7d69d53a66617
3
+ size 536223056
special_tokens_map.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "boi_token": "<start_of_image>",
3
+ "bos_token": {
4
+ "content": "<bos>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false
9
+ },
10
+ "eoi_token": "<end_of_image>",
11
+ "eos_token": {
12
+ "content": "<eos>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false
17
+ },
18
+ "image_token": "<image_soft_token>",
19
+ "pad_token": {
20
+ "content": "<pad>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false
25
+ },
26
+ "unk_token": {
27
+ "content": "<unk>",
28
+ "lstrip": false,
29
+ "normalized": false,
30
+ "rstrip": false,
31
+ "single_word": false
32
+ }
33
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4667f2089529e8e7657cfb6d1c19910ae71ff5f28aa7ab2ff2763330affad795
3
+ size 33384568
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1299c11d7cf632ef3b4e11937501358ada021bbdf7c47638d13c0ee982f2e79c
3
+ size 4689074
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff