Instructions to use K-intelligence/Midm-2.0-Base-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use K-intelligence/Midm-2.0-Base-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="K-intelligence/Midm-2.0-Base-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("K-intelligence/Midm-2.0-Base-Instruct") model = AutoModelForCausalLM.from_pretrained("K-intelligence/Midm-2.0-Base-Instruct") 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 K-intelligence/Midm-2.0-Base-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "K-intelligence/Midm-2.0-Base-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "K-intelligence/Midm-2.0-Base-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/K-intelligence/Midm-2.0-Base-Instruct
- SGLang
How to use K-intelligence/Midm-2.0-Base-Instruct 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 "K-intelligence/Midm-2.0-Base-Instruct" \ --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": "K-intelligence/Midm-2.0-Base-Instruct", "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 "K-intelligence/Midm-2.0-Base-Instruct" \ --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": "K-intelligence/Midm-2.0-Base-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use K-intelligence/Midm-2.0-Base-Instruct with Docker Model Runner:
docker model run hf.co/K-intelligence/Midm-2.0-Base-Instruct
RAG 연계시 출처 표기를 위한 프롬프트가 잘 안먹습니다.
검색결과에서 LLM 이 답변을 내보낼때 참조한 파일이나 출처에 대한 표기를 하고 싶은데, 어떠한 지시어로 해야 표기를 할 수 있을까요?
안녕하세요,
RAG 시스템에서 검색 결과 문서가 LLM 입력으로 함께 주어질 때, 답변 생성에 참조한 정확한 문서나 문서의 부분을 표기하고 싶다는 의미로 이해하였습니다.
현재 공개된 Mi:dm Base 모델은 모델 내에 이를 위한 지도학습이 수행되지 않아 이 기능(Citation)이 다소 제한적일 것으로 생각됩니다.
검색을 통해 얻을 수 있는 문서의 형식과 길이, LLM 입력 시 Context 구성 등을 고려한 데이터를 구성한 후,
추가 학습을 수행 하여야 지정한 형식과 높은 정확도로 출처 표기가 가능합니다.
감사합니다.
Hello,
I understand your requirement regarding the RAG system: you need the model to identify the specific source documents or segments used for answer generation.
However, since the current Mi:dm Base model was not trained with supervised tuning for this specific feature, its citation performance is likely to be limited.
To enable citations in a specific format with high accuracy, you must perform additional training.
This requires preparing a dataset that reflects the format and length of retrieved documents, along with the input context configuration.
Thank you.