Instructions to use theblackcat102/whale-v3-base-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use theblackcat102/whale-v3-base-merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="theblackcat102/whale-v3-base-merged", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("theblackcat102/whale-v3-base-merged", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("theblackcat102/whale-v3-base-merged", trust_remote_code=True) 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 theblackcat102/whale-v3-base-merged with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "theblackcat102/whale-v3-base-merged" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "theblackcat102/whale-v3-base-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/theblackcat102/whale-v3-base-merged
- SGLang
How to use theblackcat102/whale-v3-base-merged 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 "theblackcat102/whale-v3-base-merged" \ --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": "theblackcat102/whale-v3-base-merged", "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 "theblackcat102/whale-v3-base-merged" \ --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": "theblackcat102/whale-v3-base-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use theblackcat102/whale-v3-base-merged with Docker Model Runner:
docker model run hf.co/theblackcat102/whale-v3-base-merged
Deepseek-v3-Base Group 8 Average Weights
Since Deepseek v3 dense layers ( first 3 ) happens to be 18432 which equals to 9 x 2048. Since there's 256 experts with 2048 dimensions as the intermediate dimension, we can first average all 32 experts as 1 expert and concatenate all 8 groups into a 16384 layers. Adding the share_experts in to the new MLP layers and we can get 18432 MLP layers.
Model Details
Model Description
Unfortunately, this model doesn't work out of the box ( after dequantize and merging ) all it generates is giberish tokens. So either my code sucks or merging all that experts down breaks the model too much that every brokes.
I'm trying to recover the MLP layers by pretraining, but I'm bit low on compute and doesn't have much to spare. Also if you have small corpus which I can use feel free to comments and suggest what I should do next
QLoRA pretrained test run can be found here : theblackcat102/whale-v3-base-concept-test-lora-380
- Downloads last month
- 5