MoLora-v2
Collection
First Prototype of the second iteration of MoLora utilizing mixture of expert techniques applied to the Llama2 model. • 5 items • Updated • 2
How to use crumb/test-00-switchllama-i3b-f10b-e4-init with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="crumb/test-00-switchllama-i3b-f10b-e4-init", trust_remote_code=True) # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("crumb/test-00-switchllama-i3b-f10b-e4-init", trust_remote_code=True, dtype="auto")How to use crumb/test-00-switchllama-i3b-f10b-e4-init with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "crumb/test-00-switchllama-i3b-f10b-e4-init"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "crumb/test-00-switchllama-i3b-f10b-e4-init",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/crumb/test-00-switchllama-i3b-f10b-e4-init
How to use crumb/test-00-switchllama-i3b-f10b-e4-init with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "crumb/test-00-switchllama-i3b-f10b-e4-init" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "crumb/test-00-switchllama-i3b-f10b-e4-init",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "crumb/test-00-switchllama-i3b-f10b-e4-init" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "crumb/test-00-switchllama-i3b-f10b-e4-init",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use crumb/test-00-switchllama-i3b-f10b-e4-init with Docker Model Runner:
docker model run hf.co/crumb/test-00-switchllama-i3b-f10b-e4-init
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
this is the initial model warmstarted from openllama 3b v2 with the expert layers copied from models trained with lora on only the mlp layers, if you can find the problem with the modeling code i will send you a picture of my cat