Instructions to use microsoft/FrogMini-14B-2510 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/FrogMini-14B-2510 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="microsoft/FrogMini-14B-2510") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("microsoft/FrogMini-14B-2510") model = AutoModelForCausalLM.from_pretrained("microsoft/FrogMini-14B-2510") messages = [ {"role": "user", "content": "Who are you?"}, ] 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use microsoft/FrogMini-14B-2510 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "microsoft/FrogMini-14B-2510" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "microsoft/FrogMini-14B-2510", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/microsoft/FrogMini-14B-2510
- SGLang
How to use microsoft/FrogMini-14B-2510 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 "microsoft/FrogMini-14B-2510" \ --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": "microsoft/FrogMini-14B-2510", "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 "microsoft/FrogMini-14B-2510" \ --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": "microsoft/FrogMini-14B-2510", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use microsoft/FrogMini-14B-2510 with Docker Model Runner:
docker model run hf.co/microsoft/FrogMini-14B-2510
Update chat template to use XML tool call format.
Browse files- chat_template.jinja +10 -8
chat_template.jinja
CHANGED
|
@@ -8,12 +8,13 @@
|
|
| 8 |
{{- "\n" }}
|
| 9 |
{{- tool | tojson }}
|
| 10 |
{%- endfor %}
|
| 11 |
-
{{- "\n</tools>\n\nFor each function call,
|
| 12 |
{%- else %}
|
| 13 |
{%- if messages[0].role == 'system' %}
|
| 14 |
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
| 15 |
{%- endif %}
|
| 16 |
{%- endif %}
|
|
|
|
| 17 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
{%- for message in messages[::-1] %}
|
| 19 |
{%- set index = (messages|length - 1) - loop.index0 %}
|
|
@@ -57,15 +58,16 @@
|
|
| 57 |
{%- if tool_call.function %}
|
| 58 |
{%- set tool_call = tool_call.function %}
|
| 59 |
{%- endif %}
|
| 60 |
-
{{- '<tool_call>\n
|
| 61 |
-
{{- tool_call.name }}
|
| 62 |
-
{{- '", "arguments": ' }}
|
| 63 |
{%- if tool_call.arguments is string %}
|
| 64 |
-
{
|
| 65 |
{%- else %}
|
| 66 |
-
{
|
| 67 |
{%- endif %}
|
| 68 |
-
{
|
|
|
|
|
|
|
|
|
|
| 69 |
{%- endfor %}
|
| 70 |
{%- endif %}
|
| 71 |
{{- '<|im_end|>\n' }}
|
|
@@ -86,4 +88,4 @@
|
|
| 86 |
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 87 |
{{- '<think>\n\n</think>\n\n' }}
|
| 88 |
{%- endif %}
|
| 89 |
-
{%- endif %}
|
|
|
|
| 8 |
{{- "\n" }}
|
| 9 |
{{- tool | tojson }}
|
| 10 |
{%- endfor %}
|
| 11 |
+
{{- "\n</tools>\n\nFor each function call, use this XML format:\n\n<function=function_name>\n <parameter=param1>value1</parameter>\n <parameter=param2>value2</parameter>\n</function>\n" }}
|
| 12 |
{%- else %}
|
| 13 |
{%- if messages[0].role == 'system' %}
|
| 14 |
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
| 15 |
{%- endif %}
|
| 16 |
{%- endif %}
|
| 17 |
+
|
| 18 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 19 |
{%- for message in messages[::-1] %}
|
| 20 |
{%- set index = (messages|length - 1) - loop.index0 %}
|
|
|
|
| 58 |
{%- if tool_call.function %}
|
| 59 |
{%- set tool_call = tool_call.function %}
|
| 60 |
{%- endif %}
|
| 61 |
+
{{- '<function=' + tool_call.name + '>\n' }}
|
|
|
|
|
|
|
| 62 |
{%- if tool_call.arguments is string %}
|
| 63 |
+
{%- set args = tool_call.arguments | fromjson %}
|
| 64 |
{%- else %}
|
| 65 |
+
{%- set args = tool_call.arguments %}
|
| 66 |
{%- endif %}
|
| 67 |
+
{%- for param_name, param_value in args.items() %}
|
| 68 |
+
{{- ' <parameter=' + param_name + '>' + param_value + '</parameter>\n' }}
|
| 69 |
+
{%- endfor %}
|
| 70 |
+
{{- '</function>' }}
|
| 71 |
{%- endfor %}
|
| 72 |
{%- endif %}
|
| 73 |
{{- '<|im_end|>\n' }}
|
|
|
|
| 88 |
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 89 |
{{- '<think>\n\n</think>\n\n' }}
|
| 90 |
{%- endif %}
|
| 91 |
+
{%- endif %}
|