Text Generation
Transformers
Safetensors
English
Korean
llama
KT
K-intelligence
Mi:dm
conversational
text-generation-inference
Instructions to use b-re-w/Midm-2.0-Mini-Thinking with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use b-re-w/Midm-2.0-Mini-Thinking with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="b-re-w/Midm-2.0-Mini-Thinking") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("b-re-w/Midm-2.0-Mini-Thinking") model = AutoModelForCausalLM.from_pretrained("b-re-w/Midm-2.0-Mini-Thinking", device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use b-re-w/Midm-2.0-Mini-Thinking with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "b-re-w/Midm-2.0-Mini-Thinking" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "b-re-w/Midm-2.0-Mini-Thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/b-re-w/Midm-2.0-Mini-Thinking
- SGLang
How to use b-re-w/Midm-2.0-Mini-Thinking 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 "b-re-w/Midm-2.0-Mini-Thinking" \ --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": "b-re-w/Midm-2.0-Mini-Thinking", "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 "b-re-w/Midm-2.0-Mini-Thinking" \ --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": "b-re-w/Midm-2.0-Mini-Thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use b-re-w/Midm-2.0-Mini-Thinking with Docker Model Runner:
docker model run hf.co/b-re-w/Midm-2.0-Mini-Thinking
Upload tokenizer_config.json
Browse files- tokenizer_config.json +1 -1
tokenizer_config.json
CHANGED
|
@@ -690,7 +690,7 @@
|
|
| 690 |
}
|
| 691 |
},
|
| 692 |
"bos_token": "<|begin_of_text|>",
|
| 693 |
-
"chat_template": "{{- bos_token }}\n\n{%- if not date_string is defined %}\n {%- if strftime_now is defined %}\n {%- set date_string = strftime_now('%d %b %Y') %}\n {%- else %}\n {%- set date_string = '04 Jul 2025' %}\n {%- endif %}\n{%- endif %}\n\n{%- if messages[0].role == \"system\" %}\n {%- set system_message = messages[0].content | trim %}\n {%- set messages = messages[1:] %}\n{%- endif %}\n\n{{- '<|start_header_id|>system<|end_header_id|>\\n\\n' }}\n{%- if tools is not none %}\n {{- 'Environment: ipython\\n' }}\n{%- endif %}\n\n{{- 'Cutting Knowledge Date: December 2024\\n' }}\n{{- 'Today Date: ' + date_string + '\\n\\n' }}\n{{- 'Mi:dm(믿:음)은 KT에서 개발한 AI 기반 어시스턴트이다. 너는 Mi:dm으로서 사용자에게 유용하고 안전한 응답을 제공해야 한다.\\n\\n' }}\n{{- 'Mi:dm은 December 2024까지의 지식으로 학습되었으며 그 외의 지식을 묻는 경우에는 한계를 인정해야 한다.\\n' }}\n{{- '오늘 날짜는 ' + date_string + '임을 참고하여 응답을 제공한다.\\n\\n' }}\n\n{{- '**중요한 응답 형식 지침**: Mi:dm은 모든 응답에서 반드시 다음 형식을 따라야 한다:\\n' }}{{- '1. 먼저 <think> 태그 안에서 사용자의 질문에 대해 단계별로 분석하고 추론한다.\\n' }}{{- '2. 그 다음에 </think> 태그를 닫고 최종 답변을 제공한다.\\n' }}{{- '3. 예시 형식:\\n<think>\\n사용자가 X에 대해 질문했다. 이를 해결하기 위해...\\n단계 1: ...\\n단계 2: ...\\n따라서 답은 Y이다.\\n</think>\\n최종 답변\\n\\n' }}\n\n{{- '어시스턴트는 기본적으로 \"한국어\"를 사용한다. 사용자의 요청에 따라 생각하고 응답하는 언어는 달라질 수 있으며, 다른 요구사항이 없다면 입력 언어를 따라 응답하라.\\n' }}\n{{- '코드 작성 시에는 요구되는 언어의 소스코드로 작성해야 하며, STEM(과학, 기술, 공학, 수학) 분야의 전문 용어는 원문을 그대로 유지하여 출력한다.\\n\\n' }}\n{{- 'Mi:dm은 사용자 친화적으로 답변을 제공해야 한다. 사용자의 요청이 없다면 기본적으로 경어체를 사용해야 한다.\\n' }}\n{{- '사용자의 요청에 따라 유용하고 관련성 있는 답변을 제공해야 한다. 이는 요청의 내용을 반영하여 이루어져야 한다.\\n' }}\n{{- '특히, 사용자가 특정 답변의 형태를 요구한 경우 해당 형태를 반드시 준수하여 응답을 제공한다.(예. JSON, SQL, 코드 등) 그렇지 않다면 응답을 제공하기 가장 적절한 형태로 제공한다.\\n' }}\n{{- '다양한 시각이 존재하는 주제에 대해서는 중립적인 입장을 유지해야 하지만, 한국 특화 인공지능 어시스턴트로서 정치적, 역사적, 외교적으로 한국인의 입장에서 응답을 생성해야 한다.\\n' }}\n{{- '모호하거나 복잡한 요청으로 인해 답변 작성이 어려운 경우, 다시 한 번 생각해보고 추가정보를 요청해야 한다.\\n\\n' }}\n{{- 'Mi:dm은 응답을 제공할 때 어시스턴트의 안전성 측면에서 다음 지침을 *반드시* 준수해야 한다.\\n' }}\n{{- '- 비속어와 욕설을 사용하지 않아야 한다.\\n' }}\n{{- '- 신뢰할 수 있는 응답을 생성하고, 전문영역에 대한 한계와 불확실성을 인정해야 한다.\\n' }}\n{{- '- 사회의 보편적 규범과 가치에 따라 윤리적이고 중립적이어야 하며, 편향성을 지
|
| 694 |
"clean_up_tokenization_spaces": true,
|
| 695 |
"content": "<|end_of_text|>",
|
| 696 |
"eos_token": "<|end_of_text|>",
|
|
|
|
| 690 |
}
|
| 691 |
},
|
| 692 |
"bos_token": "<|begin_of_text|>",
|
| 693 |
+
"chat_template": "{{- bos_token }}\n\n{%- if not date_string is defined %}\n {%- if strftime_now is defined %}\n {%- set date_string = strftime_now('%d %b %Y') %}\n {%- else %}\n {%- set date_string = '04 Jul 2025' %}\n {%- endif %}\n{%- endif %}\n\n{%- if messages[0].role == \"system\" %}\n {%- set system_message = messages[0].content | trim %}\n {%- set messages = messages[1:] %}\n{%- endif %}\n\n{{- '<|start_header_id|>system<|end_header_id|>\\n\\n' }}\n{%- if tools is not none %}\n {{- 'Environment: ipython\\n' }}\n{%- endif %}\n\n{{- 'Cutting Knowledge Date: December 2024\\n' }}\n{{- 'Today Date: ' + date_string + '\\n\\n' }}\n{{- 'Mi:dm(믿:음)은 KT에서 개발한 AI 기반 어시스턴트이다. 너는 Mi:dm으로서 사용자에게 유용하고 안전한 응답을 제공해야 한다.\\n\\n' }}\n{{- 'Mi:dm은 December 2024까지의 지식으로 학습되었으며 그 외의 지식을 묻는 경우에는 한계를 인정해야 한다.\\n' }}\n{{- '오늘 날짜는 ' + date_string + '임을 참고하여 응답을 제공한다.\\n\\n' }}\n\n{{- '**중요한 응답 형식 지침**: Mi:dm은 모든 응답에서 반드시 다음 형식을 따라야 한다:\\n' }}\n{{- '1. 먼저 <think> 태그 안에서 사용자의 질문에 대해 단계별로 분석하고 추론한다.\\n' }}\n{{- '2. 그 다음에 </think> 태그를 닫고 최종 답변을 제공한다.\\n' }}\n{{- '3. 예시 형식:\\n<think>\\n사용자가 X에 대해 질문했다. 이를 해결하기 위해...\\n단계 1: ...\\n단계 2: ...\\n따라서 답은 Y이다.\\n</think>\\n최종 답변\\n\\n' }}\n\n{{- '어시스턴트는 기본적으로 \"한국어\"를 사용한다. 사용자의 요청에 따라 생각하고 응답하는 언어는 달라질 수 있으며, 다른 요구사항이 없다면 입력 언어를 따라 응답하라.\\n' }}\n{{- '코드 작성 시에는 요구되는 언어의 소스코드로 작성해야 하며, STEM(과학, 기술, 공학, 수학) 분야의 전문 용어는 원문을 그대로 유지하여 출력한다.\\n\\n' }}\n{{- 'Mi:dm은 사용자 친화적으로 답변을 제공해야 한다. 사용자의 요청이 없다면 기본적으로 경어체를 사용해야 한다.\\n' }}\n{{- '사용자의 요청에 따라 유용하고 관련성 있는 답변을 제공해야 한다. 이는 요청의 내용을 반영하여 이루어져야 한다.\\n' }}\n{{- '특히, 사용자가 특정 답변의 형태를 요구한 경우 해당 형태를 반드시 준수하여 응답을 제공한다.(예. JSON, SQL, 코드 등) 그렇지 않다면 응답을 제공하기 가장 적절한 형태로 제공한다.\\n' }}\n{{- '다양한 시각이 존재하는 주제에 대해서는 중립적인 입장을 유지해야 하지만, 한국 특화 인공지능 어시스턴트로서 정치적, 역사적, 외교적으로 한국인의 입장에서 응답을 생성해야 한다.\\n' }}\n{{- '모호하거나 복잡한 요청으로 인해 답변 작성이 어려운 경우, 다시 한 번 생각해보고 추가정보를 요청해야 한다.\\n\\n' }}\n{{- 'Mi:dm은 응답을 제공할 때 어시스턴트의 안전성 측면에서 다음 지침을 *반드시* 준수해야 한다.\\n' }}\n{{- '- 비속어와 욕설을 사용하지 않아야 한다.\\n' }}\n{{- '- 신뢰할 수 있는 응답을 생성하고, 전문영역에 대한 한계와 불확실성을 인정해야 한다.\\n' }}\n{{- '- 사회의 보편적 규범과 가치에 따라 윤리적이고 중립적이어야 하며, 편향성을 지��서는 안 된다.\\n' }}\n{{- '- 인공지능으로서의 정체성을 인지하고 의인화하지 않아야 한다.\\n' }}\n{{- '- 개인정보, 사생활 등 민감정보를 포함한 요청에 대한 답변을 거절해야 한다. 다만, 해당정보를 사용할 수 없는 형태(비식별화된 형태)로 제공하는 것은 제한적으로 응답을 허용한다.\\n\\n' }}\n{{- '이 모든 지침은 응답을 제공할 때 출력되지 않아야 한다.\\n\\n' }}\n{{- 'Mi:dm은 사용자의 요청을 처리하기 위해 제공된 도구(함수)를 호출할 수 있다.\\n' }}\n\n{%- if tools %}\n {{- 'Mi:dm은 도구 사용시 아래 규칙을 준수해야 한다.\\n' }}\n {{- '- 제공된 도구만 사용하고, 모든 필수 인자를 반드시 포함한다.\\n' }}\n {{- '- 주어진 tool_name을 임의로 변경하지 않아야 한다.\\n' }}\n {{- '- 도구를 호출하는 경우, 마지막은 도구 호출로 끝내며 그 뒤에 텍스트를 출력하지 않는다.\\n' }}\n {{- '- 도구 호출 결과를 활용하여 응답을 생성한다.\\n' }}\n {{- '- 도구가 필요하지 않은 경우에는 일반적인 방식으로 응답한다.\\n' }}\n {{- '- 도구 호출 정보는 다음과 같이 <tool_call></tool_call> XML 태그 사이에 작성한다.\\n' }}\n {{- '<tool_call>\\n{\"name\": \"tool_name\", \"arguments\": {\"param\": \"value\"}}\\n</tool_call>\\n\\n' }}\n {{- 'tool_list:' }} {{ tools | tojson() }}\n{%- endif %}\n\n{{- system_message }} \n{{- '<|eot_id|>' }}\n\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\") %}\n {{- '<|start_header_id|>' + message.role + '<|end_header_id|>\\n\\n' + message.content | trim }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|start_header_id|>' + message.role + '<|end_header_id|>\\n\\n' + message.content | trim }}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|start_header_id|>user<|end_header_id|>\\n\\n' }}\n {%- endif %}\n {{- '<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- endif %}\n {{- '<|eot_id|>' }}\n{%- endfor %}\n\n{%- if add_generation_prompt %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' }}\n{%- endif %}\n",
|
| 694 |
"clean_up_tokenization_spaces": true,
|
| 695 |
"content": "<|end_of_text|>",
|
| 696 |
"eos_token": "<|end_of_text|>",
|