Instructions to use TechxGenus/Mini-Jamba-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TechxGenus/Mini-Jamba-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TechxGenus/Mini-Jamba-v2", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TechxGenus/Mini-Jamba-v2", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("TechxGenus/Mini-Jamba-v2", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use TechxGenus/Mini-Jamba-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TechxGenus/Mini-Jamba-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TechxGenus/Mini-Jamba-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TechxGenus/Mini-Jamba-v2
- SGLang
How to use TechxGenus/Mini-Jamba-v2 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 "TechxGenus/Mini-Jamba-v2" \ --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": "TechxGenus/Mini-Jamba-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "TechxGenus/Mini-Jamba-v2" \ --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": "TechxGenus/Mini-Jamba-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TechxGenus/Mini-Jamba-v2 with Docker Model Runner:
docker model run hf.co/TechxGenus/Mini-Jamba-v2
[Request] Potential Release Of Training Code?
Hello there! I hope you're doing well today. I am planning to run training tests on different data sets, and I was wondering if you could share your training code with me. I haven't started yet, so if it's impossible, I totally understand, and it's no problem.
It is compatible with Huggingface's tools and can be trained like other LLMs, just like the example in the official repository:
from datasets import load_dataset
from trl import SFTTrainer
from peft import LoraConfig
from transformers import AutoTokenizer, AutoModelForCausalLM, TrainingArguments, AutoConfig
model_id = <Your Path Here>
tokenizer = AutoTokenizer.from_pretrained(model_id)
# model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True, device_map='auto')
config = AutoConfig.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_config(
config=config,
trust_remote_code=True,
device_map='auto'
)
dataset = load_dataset("Abirate/english_quotes", split="train")
training_args = TrainingArguments(
output_dir="./results",
num_train_epochs=3,
per_device_train_batch_size=4,
logging_dir='./logs',
logging_steps=10,
learning_rate=2e-3
)
# lora_config = LoraConfig(
# r=8,
# target_modules=["embed_tokens", "x_proj", "in_proj", "out_proj"],
# task_type="CAUSAL_LM",
# bias="none"
# )
trainer = SFTTrainer(
model=model,
tokenizer=tokenizer,
args=training_args,
# peft_config=lora_config,
train_dataset=dataset,
dataset_text_field="quote",
)
trainer.train()
I modified config.json to implement different configurations.
Thanks for sharing, in my mind at the time I was thinking you (re)wrote the architecture manually lol.