Instructions to use Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B") model = AutoModelForCausalLM.from_pretrained("Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B", 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 Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B
- SGLang
How to use Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B 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 "Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B" \ --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": "Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B", "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 "Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B" \ --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": "Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B 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 Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B 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 Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B", max_seq_length=2048, ) - Docker Model Runner
How to use Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B with Docker Model Runner:
docker model run hf.co/Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B
Can't merge this model with other 7B's
I think this model shows a lot of potential for merging but I can't seem to get it to work.
I can run the model on koboldcpp without problems, but when I try to merge it with other 7B models through mergekit, it gives me the following RuntimeError: Tensor lm_head.weight required but not present in model Severian/Mistral-v0.2-Nexus-Internal-Knowledge-Map-7B
Could this be a fixable issue in the configuration, or would it require a full retraining for it to be compatible with other models?
Great catch! I never noticed an issue, but then again I haven't fully ventured into the realm of merging yet. After inspection at the blocks and layers, it looks like it is missing a head. Strangely enough still works haha
I originally trained this on Unsloth and used a Laser-QLoRa approach so the Lm_head must have gotten dropped during the fuse or something. So strange that it seemed to function for the most part. I'll need to do a re-training to fix the issue but it definitely warrants it so that the model can be merged properly. Would love to see what results come from it!
I'll get started on the retraining this weekend and have a new, more robust version available. I'll ping you once it's up! Thanks for reaching out
Wow that really is strange indeed, I look forward to trying out the full version hahah