Duplicate from pruning/sn11-gemma2-27b-v1
Browse filesCo-authored-by: Pruning <[email protected]>
- .gitattributes +36 -0
- README.md +79 -0
- added_tokens.json +1 -0
- chat_template.json +1 -0
- config.json +1 -0
- generation_config.json +1 -0
- model-00001-of-00012.safetensors +3 -0
- model-00002-of-00012.safetensors +3 -0
- model-00003-of-00012.safetensors +3 -0
- model-00004-of-00012.safetensors +3 -0
- model-00005-of-00012.safetensors +3 -0
- model-00006-of-00012.safetensors +3 -0
- model-00007-of-00012.safetensors +3 -0
- model-00008-of-00012.safetensors +3 -0
- model-00009-of-00012.safetensors +3 -0
- model-00010-of-00012.safetensors +3 -0
- model-00011-of-00012.safetensors +3 -0
- model-00012-of-00012.safetensors +3 -0
- model.safetensors.index.json +0 -0
- preprocessor_config.json +1 -0
- processor_config.json +1 -0
- special_tokens_map.json +1 -0
- tokenizer.json +3 -0
- tokenizer.model +3 -0
- tokenizer_config.json +0 -0
.gitattributes
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz 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,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: gemma
|
3 |
+
library_name: transformers
|
4 |
+
pipeline_tag: text-generation
|
5 |
+
extra_gated_heading: Access Gemma on Hugging Face
|
6 |
+
extra_gated_prompt: >-
|
7 |
+
To access Gemma on Hugging Face, you’re required to review and agree to
|
8 |
+
Google’s usage license. To do this, please ensure you’re logged in to Hugging
|
9 |
+
Face and click below. Requests are processed immediately.
|
10 |
+
extra_gated_button_content: Acknowledge license
|
11 |
+
base_model: google/gemma-3-27b-it
|
12 |
+
tags:
|
13 |
+
- transformers
|
14 |
+
- gemma3
|
15 |
+
- gemma
|
16 |
+
- google
|
17 |
+
- Bifröst
|
18 |
+
- Bifrost
|
19 |
+
- code
|
20 |
+
---
|
21 |
+
|
22 |
+
## Bifröst-27B
|
23 |
+
|
24 |
+

|
25 |
+
|
26 |
+
Bifröst-27B is an advanced AI model built upon gemma3 architecture, specifically fine-tuned for secure and efficient enterprise-grade code generation with reasoning. Designed to meet rigorous standards of safety, accuracy, and reliability, Bifröst empowers organizations to streamline software development workflows while prioritizing security and compliance.
|
27 |
+
|
28 |
+
### Model Details
|
29 |
+
- **Model Name:** Bifröst-27B
|
30 |
+
- **Base Architecture:** gemma3
|
31 |
+
- **Application:** Enterprise Secure Code Generation
|
32 |
+
- **Release Date:** 16-March-2025
|
33 |
+
|
34 |
+
### Intended Use
|
35 |
+
Bifröst is designed explicitly for:
|
36 |
+
- Generating secure, efficient, and high-quality code.
|
37 |
+
- Supporting development tasks within regulated enterprise environments.
|
38 |
+
- Enhancing productivity by automating routine coding tasks without compromising security.
|
39 |
+
|
40 |
+
### Features
|
41 |
+
- **Security-Focused Training:** Specialized training regimen emphasizing secure coding practices, vulnerability reduction, and adherence to security standards.
|
42 |
+
- **Enterprise-Optimized Performance:** Tailored to support various programming languages and enterprise frameworks with robust, context-aware suggestions.
|
43 |
+
- **Compliance-Driven Design:** Incorporates features to aid in maintaining compliance with industry-specific standards (e.g., GDPR, HIPAA, SOC 2).
|
44 |
+
|
45 |
+
### Limitations
|
46 |
+
- Bifröst should be used under human supervision to ensure code correctness and security compliance.
|
47 |
+
- Model-generated code should undergo appropriate security and quality assurance checks before deployment.
|
48 |
+
|
49 |
+
### Ethical Considerations
|
50 |
+
- Users are encouraged to perform regular audits and compliance checks on generated outputs.
|
51 |
+
- Enterprises should implement responsible AI practices to mitigate biases or unintended consequences.
|
52 |
+
|
53 |
+
### Usage
|
54 |
+
Below are some quick-start instructions for using the model with the `transformers` library.
|
55 |
+
|
56 |
+
#### Installation
|
57 |
+
```sh
|
58 |
+
$ pip install git+https://github.com/huggingface/[email protected]
|
59 |
+
```
|
60 |
+
|
61 |
+
#### Running with the `pipeline` API
|
62 |
+
```python
|
63 |
+
from transformers import pipeline
|
64 |
+
import torch
|
65 |
+
|
66 |
+
pipe = pipeline(
|
67 |
+
"text-generation",
|
68 |
+
model="OpenGenerativeAI/Bifrost-27B",
|
69 |
+
device="cuda",
|
70 |
+
torch_dtype=torch.bfloat16
|
71 |
+
)
|
72 |
+
|
73 |
+
messages = [{"role": "user", "content": "Generate a secure API key management system."}]
|
74 |
+
output = pipe(text=messages, max_new_tokens=200)
|
75 |
+
print(output[0]["generated_text"])
|
76 |
+
```
|
77 |
+
|
78 |
+
## Terms of Use
|
79 |
+
This model is released under the **Gemma license**. Users must comply with [Google's Gemma Terms of Use](https://ai.google.dev/gemma/terms), including restrictions on redistribution, modification, and commercial use.
|
added_tokens.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"<image_soft_token>": 262144}
|
chat_template.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"chat_template": "{{ bos_token }}\n{%- if messages[0]['role'] == 'system' -%}\n {%- if messages[0]['content'] is string -%}\n {%- set first_user_prefix = messages[0]['content'] + '\n\n' -%}\n {%- else -%}\n {%- set first_user_prefix = messages[0]['content'][0]['text'] + '\n\n' -%}\n {%- endif -%}\n {%- set loop_messages = messages[1:] -%}\n{%- else -%}\n {%- set first_user_prefix = \"\" -%}\n {%- set loop_messages = messages -%}\n{%- endif -%}\n{%- for message in loop_messages -%}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception(\"Conversation roles must alternate user/assistant/user/assistant/...\") }}\n {%- endif -%}\n {%- if (message['role'] == 'assistant') -%}\n {%- set role = \"model\" -%}\n {%- else -%}\n {%- set role = message['role'] -%}\n {%- endif -%}\n {{ '<start_of_turn>' + role + '\n' + (first_user_prefix if loop.first else \"\") }}\n {%- if message['content'] is string -%}\n {{ message['content'] | trim }}\n {%- elif message['content'] is iterable -%}\n {%- for item in message['content'] -%}\n {%- if item['type'] == 'image' -%}\n {{ '<start_of_image>' }}\n {%- elif item['type'] == 'text' -%}\n {{ item['text'] | trim }}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{ raise_exception(\"Invalid content type\") }}\n {%- endif -%}\n {{ '<end_of_turn>\n' }}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{'<start_of_turn>model\n'}}\n{%- endif -%}\n"}
|
config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"architectures": ["Gemma3ForConditionalGeneration"], "boi_token_index": 255999, "eoi_token_index": 256000, "eos_token_id": [1, 106], "image_token_index": 262144, "initializer_range": 0.02, "mm_tokens_per_image": 256, "model_type": "gemma3", "text_config": {"head_dim": 128, "hidden_size": 5376, "intermediate_size": 21504, "model_type": "gemma3_text", "num_attention_heads": 32, "num_hidden_layers": 62, "num_key_value_heads": 16, "query_pre_attn_scalar": 168, "rope_scaling": {"factor": 8.0, "rope_type": "linear"}, "sliding_window": 1024}, "torch_dtype": "bfloat16", "transformers_version": "4.50.0.dev0", "vision_config": {"hidden_size": 1152, "image_size": 896, "intermediate_size": 4304, "model_type": "siglip_vision_model", "num_attention_heads": 16, "num_hidden_layers": 27, "patch_size": 14, "vision_use_head": false}}
|
generation_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"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.50.0.dev0"}
|
model-00001-of-00012.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:75bbf6440ab3579b12ee34240f3b9f3d70360a66a0d80cebdd40a217dbfc6b1e
|
3 |
+
size 4854573664
|
model-00002-of-00012.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:331580dfd87d22478e24af59d085b9da90edb101b635a5ebed729ee5d8fc7ea3
|
3 |
+
size 4954792912
|
model-00003-of-00012.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0a3d7137386e2e7f4433a7e8e4975abf2afa5f474d56cc04a367baa8d5e15456
|
3 |
+
size 4954792944
|
model-00004-of-00012.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d1cadb4f64d714f418d4665835f5412564dafae476f2deb5bdecd80bf75ae25c
|
3 |
+
size 4954792984
|
model-00005-of-00012.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1dfa5725daf776f92262d4e8ad3178cd81de6973d25b2ecb9b4867f9742cb1b8
|
3 |
+
size 4954792984
|
model-00006-of-00012.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a31a04f184ba4696f6d0805c42e9204233f29ea96dc5e38275e2b2fc384b1e7d
|
3 |
+
size 4954792984
|
model-00007-of-00012.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7828b2e94c0a0b15fe427d25c85c67b95d4f5d0ffe276e75ff612a136fb82e69
|
3 |
+
size 4954792984
|
model-00008-of-00012.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c631715486b47762f60a809322b2674dba357c66022819aa6f4c8c1507cdbc65
|
3 |
+
size 4954792984
|
model-00009-of-00012.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:287f982850418c45c135d3b1d6449b5205b222420833b2088f59dd1432bae2ef
|
3 |
+
size 4954792984
|
model-00010-of-00012.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6149b7d0d36b1e121522149ed852e1879fe2cc314fd778fe5cddefb992a41841
|
3 |
+
size 4954792984
|
model-00011-of-00012.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bcf0aa85ce2cb7c1f383085cde3c3cf593188e3d00c70a62278fd0742b8f0018
|
3 |
+
size 4954792984
|
model-00012-of-00012.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8796d88227a30afaba7cc9503cb8944bd13098692f81a127aac7ec253786c9c6
|
3 |
+
size 462476664
|
model.safetensors.index.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
preprocessor_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"do_convert_rgb": null, "do_normalize": true, "do_pan_and_scan": null, "do_rescale": true, "do_resize": true, "image_mean": [0.5, 0.5, 0.5], "image_processor_type": "Gemma3ImageProcessor", "image_seq_length": 256, "image_std": [0.5, 0.5, 0.5], "pan_and_scan_max_num_crops": null, "pan_and_scan_min_crop_size": null, "pan_and_scan_min_ratio_to_activate": null, "processor_class": "Gemma3Processor", "resample": 2, "rescale_factor": 0.00392156862745098, "size": {"height": 896, "width": 896}}
|
processor_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"image_seq_length": 256, "processor_class": "Gemma3Processor"}
|
special_tokens_map.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"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}}
|
tokenizer.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f82f739d52fe370d3375e253b69fb8c363ea96e4e95dee962a401aadfc6f2a05
|
3 |
+
size 20323113
|
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
|
|