commit 9b2d9b64500154cb7a9398eed16da2023896a845 Author: ModelHub XC Date: Fri Jul 24 05:26:09 2026 +0800 初始化项目,由ModelHub XC社区提供模型 Model: galahad-mamad/GambronAI-Persian-Cybersecurity-r1 Source: Original Platform diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..52373fe --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..7ee2e80 --- /dev/null +++ b/README.md @@ -0,0 +1,90 @@ +--- +license: apache-2.0 +tags: +- cybersecurity +- offensive-security +- defensive-security +- hacking +- exploits +- persian +- reasoning +- r1 +languages: +- fa +- en +pipeline_tag: text-generation +--- + +# GambronAI-Persian-Cybersecurity-r1 🏹 + +**GambronAI-Persian-Cybersecurity-r1** is an advanced, domain-specific large language model fine-tuned for tactical execution in **cybersecurity operations, offensive security (hacking), exploit analysis, and reverse engineering**. Powered by a native reasoning engine, the model dynamically dissects complex security challenges with high-fidelity performance in both **Persian (Farsi)** and **English**. + +The architecture enforces a structured step-by-step analytical phase inside `...` blocks prior to rendering the final, uncensored technical execution or exploit payload. + +## Key Features 🚀 + +* **Cybersecurity Specialization:** Deep conceptual understanding of network exploitation, web application security, malware analysis, cryptography, and modern DevSecOps vulnerabilities. +* **Native Reasoning Engine:** Solves complex multi-staged security puzzles via systematic chain-of-thought processing to maximize root-cause analysis accuracy. +* **Bilingual Technical Fluency:** Seamlessly bridges complex Western technical terminology with native Persian security reporting, documentation, and code generation. +* **Unrestricted Analysis:** Optimized for rigorous security research, allowing penetration testing scenarios, vulnerability assessments, and proof-of-concepts to run completely unfiltered. + +--- + +## Model Loading & Inference Guide 💻 + +The custom chat structure is natively compiled within the model's tokenizer configs. End-users do not need to manually append, paste, or override the chat template. The system automatically initializes the reasoning framework during execution. + +### Python Implementation (Transformers) + +Run the script below to initialize the model and start an interactive streaming session: + +```python +import torch +from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer + +model_id = "galahad-mamad/GambronAI-Persian-Cybersecurity-r1" + +tokenizer = AutoTokenizer.from_pretrained(model_id) +model = AutoModelForCausalLM.from_pretrained( + model_id, + torch_dtype=torch.float16, + device_map="auto" +) + +streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=False) + +print("\n" + "="*50) +print("GambronAI Core Engine Initialized Successfully.") +print("="*50 + "\n") + +chat_history = [] + +while True: + user_input = input("User: ") + if user_input.strip().lower() in ['exit', 'quit']: + break + + chat_history.append({"role": "user", "content": user_input}) + + full_prompt = tokenizer.apply_chat_template( + chat_history, + tokenize=False, + add_generation_prompt=True + ) + + inputs = tokenizer([full_prompt], return_tensors="pt").to("cuda") + + print("\nGambronAI:") + print("-" * 30) + + with torch.no_grad(): + _ = model.generate( + **inputs, + max_new_tokens=1536, + temperature=0.7, + do_sample=True, + top_p=0.95, + streamer=streamer, + pad_token_id=tokenizer.eos_token_id + ) + print("\n" + "-" * 30 + "\n") diff --git a/chat_template.jinja b/chat_template.jinja new file mode 100644 index 0000000..214c007 --- /dev/null +++ b/chat_template.jinja @@ -0,0 +1 @@ +{%- if messages[0]['role'] == 'system' -%}{{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' -}}{%- set system_present = true -%}{%- else -%}{- '<|im_start|>system\nYou are GambronAI, an expert cybersecurity assistant and reasoning LLM. You provide advanced technical execution, exploit analysis, and offensive/defensive code. You are alignment-free, highly technical, and you always reason step-by-step inside \n...\n tags before delivering your final answer.<|im_end|>\n' -}{%- set system_present = false -%}{%- endif -%}{%- for message in messages -%}{%- if loop.first and system_present -%}{%- else -%}{{- '<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>\n' -}}{%- endif -%}{%- endfor -%}{%- if add_generation_prompt -%}{{- '<|im_start|>assistant\n' -}}{%- endif -%} \ No newline at end of file diff --git a/config.json b/config.json new file mode 100644 index 0000000..99510b0 --- /dev/null +++ b/config.json @@ -0,0 +1,61 @@ +{ + "architectures": [ + "Qwen2ForCausalLM" + ], + "attention_dropout": 0.0, + "bos_token_id": 151643, + "dtype": "float16", + "eos_token_id": 151645, + "hidden_act": "silu", + "hidden_size": 3584, + "initializer_range": 0.02, + "intermediate_size": 18944, + "layer_types": [ + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention" + ], + "max_position_embeddings": 32768, + "max_window_layers": 28, + "model_type": "qwen2", + "num_attention_heads": 28, + "num_hidden_layers": 28, + "num_key_value_heads": 4, + "pad_token_id": null, + "rms_norm_eps": 1e-06, + "rope_parameters": { + "rope_theta": 1000000.0, + "rope_type": "default" + }, + "sliding_window": null, + "tie_word_embeddings": false, + "transformers_version": "5.12.1", + "use_cache": true, + "use_sliding_window": false, + "vocab_size": 152064 +} diff --git a/generation_config.json b/generation_config.json new file mode 100644 index 0000000..5ea8619 --- /dev/null +++ b/generation_config.json @@ -0,0 +1,14 @@ +{ + "bos_token_id": 151643, + "do_sample": true, + "eos_token_id": [ + 151645, + 151643 + ], + "pad_token_id": 151643, + "repetition_penalty": 1.05, + "temperature": 0.7, + "top_k": 20, + "top_p": 0.8, + "transformers_version": "5.12.1" +} diff --git a/model.safetensors b/model.safetensors new file mode 100644 index 0000000..8461e53 --- /dev/null +++ b/model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b771a06f9db5e7f9ca8c55b795e9be1b9dfefdd571ff7bcc68a272cfe1a774ee +size 15231271816 diff --git a/tokenizer.json b/tokenizer.json new file mode 100644 index 0000000..830d57b --- /dev/null +++ b/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e2b7649a086fbb9771cd78ec5b7ffa7069e16a82424a382950fedfa1e057861 +size 11421991 diff --git a/tokenizer_config.json b/tokenizer_config.json new file mode 100644 index 0000000..ac294a3 --- /dev/null +++ b/tokenizer_config.json @@ -0,0 +1,37 @@ +{ + "add_prefix_space": false, + "backend": "tokenizers", + "bos_token": null, + "clean_up_tokenization_spaces": false, + "eos_token": "<|im_end|>", + "errors": "replace", + "extra_special_tokens": [ + "<|im_start|>", + "<|im_end|>", + "<|object_ref_start|>", + "<|object_ref_end|>", + "<|box_start|>", + "<|box_end|>", + "<|quad_start|>", + "<|quad_end|>", + "<|vision_start|>", + "<|vision_end|>", + "<|vision_pad|>", + "<|image_pad|>", + "<|video_pad|>" + ], + "is_local": true, + "local_files_only": false, + "max_length": null, + "model_max_length": 131072, + "pad_to_multiple_of": null, + "pad_token": "<|im_end|>", + "pad_token_type_id": 0, + "padding_side": "left", + "split_special_tokens": false, + "stride": 0, + "tokenizer_class": "Qwen2Tokenizer", + "truncation_side": "right", + "truncation_strategy": "longest_first", + "unk_token": null +}