初始化项目,由ModelHub XC社区提供模型

Model: Sashvat/HQQ-270M
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-05-28 10:36:19 +08:00
commit 56c20228e6
13 changed files with 51705 additions and 0 deletions

36
.gitattributes vendored Normal file
View 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

14
LICENSE Normal file
View File

@@ -0,0 +1,14 @@
Sashvat AI License v1.0
Permission is hereby granted to use, copy, modify, and distribute this model and derivative works for any purpose, including commercial use, provided that proper attribution is given.
Attribution Requirement:
Any use, redistribution, or derivative of this model must include a clear and visible attribution statement:
"Made by Sashvat AI"
This attribution must appear in any papers, blog posts, apps, services, or other works that use the model or its derivatives.
Disclaimer:
This model is provided "as is" without warranties of any kind, express or implied.
Sashvat AI shall not be held liable for any damages arising from the use of this model.

BIN
Metric.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

159
README.md Normal file
View File

@@ -0,0 +1,159 @@
---
language:
- en
base_model:
- google/gemma-3-270m-it
library_name: transformers
tags:
- NukeverseAi
- HQQ
- HQQ-270M
- HQQ_270M
- DeepResearch
- gemma3
- gpt_oss
pipeline_tag: text-generation
license: other
---
# 🚀 Introducing : HQQ-270M
## Overview :-
**HQQ-270M** model is developed by **Sashvat AI** by finetuning [Gemma-3](https://huggingface.co/google/gemma-3-270m-it)
It specializes in **transforming complex, multi-layered user queries into optimized, high-quality Google search queries** .
⚠️ **Usage Requirement :**
All input queries **must begin with the prefix `HQQ:`** ( short for **High Quality Query** ) .
This ensures the model knows the input is intended for query optimization .
---
## 🔍 What does it do?
- Converts **Deep research prompts** into precise search queries.
- Handles **Broad or ambiguous questions** by breaking them into focused, search-ready chunks.
- Enhances **information retrieval** by optimizing queries for search engines.
This model is ideal for :
- Researchers
- Students
- Analysts
- Anyone needing **faster + higher-quality search results** .
---
## ✨ Key Features :
- **Fine-tuned from Gemma-3** → retains strong language reasoning .
- **Fast & Efficient** → Gemma's architecture is designed to make the model fast & efficient .
- **Optimized for real-world queries** → search queries are short, relevant, and actionable.
- **Prefix-activated (`HQQ:`)** → ensures model is used for its intended purpose.
---
## 📦 How to Use
### 🔧 Installation
```bash
pip install transformers accelerate huggingface_hub
```
### 🖥️ Inference
``` python
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Sashvat/HQQ-270M")
model = AutoModelForCausalLM.from_pretrained("Sashvat/HQQ-270M")
system_prompt = """
Convert text after "HQQ: " into an optimized Google search query. Extract key terms, remove filler words, focus on searchable keywords.
"""
query = "HQQ: What are the economic, political, and environmental implications of large-scale adoption of nuclear fusion by 2050?"
messages = [
{"role": "system", "content": system_prompt },
{"role": "user", "content": query }
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
```
---
## 🚀 Example Output :-
**Input:**
> `HQQ: What are the economic, political, and environmental implications of large-scale adoption of nuclear fusion by 2050?`
**Output :**
> `"economic political environmental implications" "large-scale adoption nuclear fusion" 2050`
---
### Training Loss vs Steps :-
`Note` : **500 Steps / ~6 Epochs**
<img src="https://huggingface.co/Sashvat/HQQ-270M/resolve/main/Metric.png">
---
## 📊 Intended Use :-
This model is intended for :
- Query optimization for **Google search and other search engines**
- **Information retrieval pipelines** .
- Assisting **deep research tasks** .
⚠️ **Important :** Input must **always** begin with `HQQ:` . Without this prefix , results may be unpredictable .
---
## 📜 License
This model is released under the **Sashvat AI License v1.0**.
You may freely use, modify, and distribute this model, including for commercial purposes .
However, any use **must clearly state** :
**"Made by Sashvat AI"**
📄 Full license: [LICENSE](https://huggingface.co/Sashvat/HQQ-270M/blob/main/LICENSE)
---
## 🏢 About Sashvat AI
We are **Sashvat AI**, from BHARAT 🕉️ . building next-generation productivity tools, AI agents, and research accelerators .
---
## 📌 Citation
If you use this model, please cite :
```
@misc{2025-SashvatAI-HQQ-270M,
title = {HQQ-270M},
author = {SashvatAI},
year = {2025},
url = {https://huggingface.co/Sashvat/HQQ-270M}
}
```
---

3
added_tokens.json Normal file
View File

@@ -0,0 +1,3 @@
{
"<image_soft_token>": 262144
}

47
chat_template.jinja Normal file
View 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 -%}

54
config.json Normal file
View File

@@ -0,0 +1,54 @@
{
"_sliding_window_pattern": 6,
"architectures": [
"Gemma3ForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"attn_logit_softcapping": null,
"bos_token_id": 2,
"eos_token_id": 1,
"final_logit_softcapping": null,
"head_dim": 256,
"hidden_activation": "gelu_pytorch_tanh",
"hidden_size": 640,
"initializer_range": 0.02,
"intermediate_size": 2048,
"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"
],
"max_position_embeddings": 32768,
"model_type": "gemma3_text",
"num_attention_heads": 4,
"num_hidden_layers": 18,
"num_key_value_heads": 1,
"pad_token_id": 0,
"query_pre_attn_scalar": 256,
"rms_norm_eps": 1e-06,
"rope_local_base_freq": 10000.0,
"rope_scaling": null,
"rope_theta": 1000000.0,
"sliding_window": 512,
"torch_dtype": "bfloat16",
"transformers_version": "4.55.2",
"use_bidirectional_attention": false,
"use_cache": true,
"vocab_size": 262144
}

11
generation_config.json Normal file
View File

@@ -0,0 +1,11 @@
{
"cache_implementation": "hybrid",
"do_sample": true,
"eos_token_id": [
1,
106
],
"top_k": 64,
"top_p": 0.95,
"transformers_version": "4.55.2"
}

3
model.safetensors Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1ef2a8590be17daec4581c03b1b079a68e488e57f71d588df7f0c8555b61ec20
size 536223056

27
special_tokens_map.json Normal file
View File

@@ -0,0 +1,27 @@
{
"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": "<eos>",
"unk_token": {
"content": "<unk>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

3
tokenizer.json Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5c3a398bbadacc43b7ef02a9b3c7b7a5f9f01e94e68fd686d5aa230024829e58
size 33384832

3
tokenizer.model Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1299c11d7cf632ef3b4e11937501358ada021bbdf7c47638d13c0ee982f2e79c
size 4689074

51345
tokenizer_config.json Normal file

File diff suppressed because it is too large Load Diff