Transformers
Safetensors
PEFT
English
text-generation-inference
gemma4
lora
cybersecurity
docker
container-security
devsecops
Instructions to use rezaduty/gemma4-e2b-docker-container-security with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rezaduty/gemma4-e2b-docker-container-security with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("rezaduty/gemma4-e2b-docker-container-security", dtype="auto") - PEFT
How to use rezaduty/gemma4-e2b-docker-container-security with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
| {{ bos_token }}{%- macro strip_thinking(text) -%} | |
| {%- set ns = namespace(result='') -%} | |
| {%- for part in text.split('<channel|>') -%} | |
| {%- if '<|channel>' in part -%} | |
| {%- set ns.result = ns.result + part.split('<|channel>')[0] -%} | |
| {%- else -%} | |
| {%- set ns.result = ns.result + part -%} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {{- ns.result | trim -}} | |
| {%- endmacro -%} | |
| {%- set thinking = enable_thinking is defined and enable_thinking -%} | |
| {%- set loop_messages = messages -%} | |
| {%- if messages[0]['role'] in ['system', 'developer'] or thinking -%} | |
| {{ '<|turn>system | |
| ' }} | |
| {%- if thinking -%} | |
| {{ '<|think|> | |
| ' }} | |
| {%- endif -%} | |
| {%- if messages[0]['role'] in ['system', 'developer'] -%} | |
| {{ messages[0]['content'] | trim }} | |
| {%- set loop_messages = messages[1:] -%} | |
| {%- endif -%} | |
| {{ '<turn|> | |
| ' }} | |
| {%- 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 -%} | |
| {{ '<|turn>' + role + ' | |
| ' }} | |
| {%- if message['content'] is string -%} | |
| {%- if role == "model" -%} | |
| {{ strip_thinking(message['content']) }} | |
| {%- else -%} | |
| {{ message['content'] | trim }} | |
| {%- endif -%} | |
| {%- elif message['content'] is iterable -%} | |
| {%- for item in message['content'] -%} | |
| {%- if item['type'] == 'audio' -%} | |
| {{ '<|audio|>' }} | |
| {%- elif item['type'] == 'image' -%} | |
| {{ '<|image|>' }} | |
| {%- elif item['type'] == 'video' -%} | |
| {{ '<|video|>' }} | |
| {%- elif item['type'] == 'text' -%} | |
| {%- if role == "model" -%} | |
| {{ strip_thinking(item['text']) }} | |
| {%- else -%} | |
| {{ item['text'] | trim }} | |
| {%- endif -%} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%- else -%} | |
| {{ raise_exception("Invalid content type") }} | |
| {%- endif -%} | |
| {{ '<turn|> | |
| ' }} | |
| {%- endfor -%} | |
| {%- if add_generation_prompt -%} | |
| {{'<|turn>model | |
| '}} | |
| {%- endif -%} | |