Text Generation
Transformers
Safetensors
PEFT
English
function-calling
xkcd
gemma
unsloth
lora
conversational
Instructions to use gnumanth/xkcd-functiongemma with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gnumanth/xkcd-functiongemma with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gnumanth/xkcd-functiongemma") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("gnumanth/xkcd-functiongemma", dtype="auto") - PEFT
How to use gnumanth/xkcd-functiongemma with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use gnumanth/xkcd-functiongemma with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gnumanth/xkcd-functiongemma" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gnumanth/xkcd-functiongemma", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gnumanth/xkcd-functiongemma
- SGLang
How to use gnumanth/xkcd-functiongemma with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "gnumanth/xkcd-functiongemma" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gnumanth/xkcd-functiongemma", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "gnumanth/xkcd-functiongemma" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gnumanth/xkcd-functiongemma", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use gnumanth/xkcd-functiongemma with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for gnumanth/xkcd-functiongemma to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for gnumanth/xkcd-functiongemma to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for gnumanth/xkcd-functiongemma to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="gnumanth/xkcd-functiongemma", max_seq_length=2048, ) - Docker Model Runner
How to use gnumanth/xkcd-functiongemma with Docker Model Runner:
docker model run hf.co/gnumanth/xkcd-functiongemma
Upload model trained with Unsloth
Browse filesUpload model trained with Unsloth 2x faster
- chat_template.jinja +3 -0
- special_tokens_map.json +8 -2
- tokenizer.json +2 -2
- tokenizer_config.json +3 -3
chat_template.jinja
CHANGED
|
@@ -139,6 +139,9 @@ declaration:{{- tool_data['function']['name'] -}}
|
|
| 139 |
{%- endfor -%}
|
| 140 |
{%- endif -%}
|
| 141 |
{%- set loop_messages = messages[1:] -%}
|
|
|
|
|
|
|
|
|
|
| 142 |
{%- endif -%}
|
| 143 |
{%- if tools -%}
|
| 144 |
{%- for tool in tools %}
|
|
|
|
| 139 |
{%- endfor -%}
|
| 140 |
{%- endif -%}
|
| 141 |
{%- set loop_messages = messages[1:] -%}
|
| 142 |
+
{%- else -%}
|
| 143 |
+
{{- 'You are a model that can do function calling with the following functions' -}}
|
| 144 |
+
{%- set loop_messages = messages -%}
|
| 145 |
{%- endif -%}
|
| 146 |
{%- if tools -%}
|
| 147 |
{%- for tool in tools %}
|
special_tokens_map.json
CHANGED
|
@@ -9,14 +9,20 @@
|
|
| 9 |
},
|
| 10 |
"eoi_token": "<end_of_image>",
|
| 11 |
"eos_token": {
|
| 12 |
-
"content": "<
|
| 13 |
"lstrip": false,
|
| 14 |
"normalized": false,
|
| 15 |
"rstrip": false,
|
| 16 |
"single_word": false
|
| 17 |
},
|
| 18 |
"image_token": "<image_soft_token>",
|
| 19 |
-
"pad_token":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
"sfr_token": "<start_function_response>",
|
| 21 |
"unk_token": {
|
| 22 |
"content": "<unk>",
|
|
|
|
| 9 |
},
|
| 10 |
"eoi_token": "<end_of_image>",
|
| 11 |
"eos_token": {
|
| 12 |
+
"content": "<end_of_turn>",
|
| 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 |
"sfr_token": "<start_function_response>",
|
| 27 |
"unk_token": {
|
| 28 |
"content": "<unk>",
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b6b09a0b4a803ad453063ca4bb49a784540e8120004e2450e025df2b27d41fb2
|
| 3 |
+
size 33384899
|
tokenizer_config.json
CHANGED
|
@@ -51335,7 +51335,7 @@
|
|
| 51335 |
"bos_token": "<bos>",
|
| 51336 |
"clean_up_tokenization_spaces": false,
|
| 51337 |
"eoi_token": "<end_of_image>",
|
| 51338 |
-
"eos_token": "<
|
| 51339 |
"extra_special_tokens": {
|
| 51340 |
"boi_token": "<start_of_image>",
|
| 51341 |
"eoi_token": "<end_of_image>",
|
|
@@ -51343,8 +51343,8 @@
|
|
| 51343 |
"sfr_token": "<start_function_response>"
|
| 51344 |
},
|
| 51345 |
"image_token": "<image_soft_token>",
|
| 51346 |
-
"model_max_length":
|
| 51347 |
-
"pad_token": "<
|
| 51348 |
"padding_side": "left",
|
| 51349 |
"sfr_token": "<start_function_response>",
|
| 51350 |
"sp_model_kwargs": null,
|
|
|
|
| 51335 |
"bos_token": "<bos>",
|
| 51336 |
"clean_up_tokenization_spaces": false,
|
| 51337 |
"eoi_token": "<end_of_image>",
|
| 51338 |
+
"eos_token": "<end_of_turn>",
|
| 51339 |
"extra_special_tokens": {
|
| 51340 |
"boi_token": "<start_of_image>",
|
| 51341 |
"eoi_token": "<end_of_image>",
|
|
|
|
| 51343 |
"sfr_token": "<start_function_response>"
|
| 51344 |
},
|
| 51345 |
"image_token": "<image_soft_token>",
|
| 51346 |
+
"model_max_length": 32768,
|
| 51347 |
+
"pad_token": "<pad>",
|
| 51348 |
"padding_side": "left",
|
| 51349 |
"sfr_token": "<start_function_response>",
|
| 51350 |
"sp_model_kwargs": null,
|