Midnight Miqu v1.0
Collection
Quants of Sophosympatheia's Midnight Miqu series of models. • 15 items • Updated
How to use Dracones/Midnight-Miqu-103B-v1.0_exl2_3.5bpw with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Dracones/Midnight-Miqu-103B-v1.0_exl2_3.5bpw")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Dracones/Midnight-Miqu-103B-v1.0_exl2_3.5bpw")
model = AutoModelForCausalLM.from_pretrained("Dracones/Midnight-Miqu-103B-v1.0_exl2_3.5bpw")
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]:]))How to use Dracones/Midnight-Miqu-103B-v1.0_exl2_3.5bpw with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Dracones/Midnight-Miqu-103B-v1.0_exl2_3.5bpw"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Dracones/Midnight-Miqu-103B-v1.0_exl2_3.5bpw",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/Dracones/Midnight-Miqu-103B-v1.0_exl2_3.5bpw
How to use Dracones/Midnight-Miqu-103B-v1.0_exl2_3.5bpw with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Dracones/Midnight-Miqu-103B-v1.0_exl2_3.5bpw" \
--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": "Dracones/Midnight-Miqu-103B-v1.0_exl2_3.5bpw",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "Dracones/Midnight-Miqu-103B-v1.0_exl2_3.5bpw" \
--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": "Dracones/Midnight-Miqu-103B-v1.0_exl2_3.5bpw",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use Dracones/Midnight-Miqu-103B-v1.0_exl2_3.5bpw with Docker Model Runner:
docker model run hf.co/Dracones/Midnight-Miqu-103B-v1.0_exl2_3.5bpw
This is a 3.5bpw EXL2 quant of sophosympatheia/Midnight-Miqu-103B-v1.0
Details about the model and the merge info can be found at the above mode page.
This is the script used for quantization.
#!/bin/bash
# Activate the conda environment
source ~/miniconda3/etc/profile.d/conda.sh
conda activate exllamav2
# Define variables
MODEL_DIR="models/sophosympatheia_Midnight-Miqu-103B-v1.0"
OUTPUT_DIR="exl2_midnight103b"
MEASUREMENT_FILE="measurements/midnight103b.json"
BIT_PRECISION=3.5
CONVERTED_FOLDER="models/Midnight-Miqu-103B_exl2_3.5bpw"
# Create directories
mkdir $OUTPUT_DIR
mkdir $CONVERTED_FOLDER
# Run conversion commands
python convert.py -i $MODEL_DIR -o $OUTPUT_DIR -nr -om $MEASUREMENT_FILE
python convert.py -i $MODEL_DIR -o $OUTPUT_DIR -nr -m $MEASUREMENT_FILE -b $BIT_PRECISION -cf $CONVERTED_FOLDER