Text Generation
Transformers
Safetensors
Korean
English
llama
conversational
text-generation-inference
Instructions to use jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview") model = AutoModelForCausalLM.from_pretrained("jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview") 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
- vLLM
How to use jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview
- SGLang
How to use jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview 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 "jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview" \ --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": "jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview", "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 "jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview" \ --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": "jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview with Docker Model Runner:
docker model run hf.co/jaeyong2/Midm-2.0-Mini-Reason-SFT-Preview
reasoning example : input
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "jaeyong2/Midm-2.0-Reason-SFT"
# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
prompt = "2의 제곱근은 뭐야?"
# message for inference
messages = [
{"role": "system",
"content": "Mi:dm(믿:음)은 KT에서 개발한 AI 기반 어시스턴트이다."},
{"role": "user", "content": prompt}
]
input_ids = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt"
)
output = model.generate(
input_ids.to("cuda"),
eos_token_id=tokenizer.eos_token_id,
max_new_tokens=1024,
do_sample=False,
)
print(tokenizer.decode(output[0]))
reasoing example result
<think>
2의 제곱근에 대해 설명드리겠습니다.
2의 제곱근은 2를 곱한 수를 의미합니다. 즉, 어떤 수 x가 2의 제곱근이라는 것은 x × x = 2를 만족하는 수 x를 말합니다.
수학적으로 표현하면 다음과 같습니다:
x² = 2
x = √2
따라서 2의 제곱근은 √2입니다.
참고로 √2는 무리수이며, 약분하면 1.4142...가 됩니다.
</think>
2의 제곱근은 √2입니다.
License
- K-intelligence/Midm-2.0-Mini-Instruct : https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/mit.md
Acknowledgement
This research is supported by TPU Research Cloud program.
- Downloads last month
- 1