Instructions to use arlineka/manbasya_2x7b_MOE with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use arlineka/manbasya_2x7b_MOE with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="arlineka/manbasya_2x7b_MOE")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("arlineka/manbasya_2x7b_MOE") model = AutoModelForCausalLM.from_pretrained("arlineka/manbasya_2x7b_MOE") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use arlineka/manbasya_2x7b_MOE with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "arlineka/manbasya_2x7b_MOE" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "arlineka/manbasya_2x7b_MOE", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/arlineka/manbasya_2x7b_MOE
- SGLang
How to use arlineka/manbasya_2x7b_MOE 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 "arlineka/manbasya_2x7b_MOE" \ --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": "arlineka/manbasya_2x7b_MOE", "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 "arlineka/manbasya_2x7b_MOE" \ --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": "arlineka/manbasya_2x7b_MOE", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use arlineka/manbasya_2x7b_MOE with Docker Model Runner:
docker model run hf.co/arlineka/manbasya_2x7b_MOE
AWQ Quantized
!pip install git+https://github.com/huggingface/transformers.git -q
!pip install huggingface_hub
!pip install autoawq -q
from awq import AutoAWQForCausalLM
from transformers import AutoTokenizer
import torch
# Assuming your model and tokenizer are loaded
model_name_or_path = "arlineka/manbasya_2x7b_MOE"
model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layer=True, trust_remote_code=False, safetensors=True)
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
# Set device to CUDA if available
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Move model to the device
model.to(device)
# Prepare your input text and move input tensors to the same device
input_text = "Hello. Input Here"
input_ids = tokenizer.encode(input_text, return_tensors="pt").to(device)
# Now generate text with model and input tensors on the same device
output = model.generate(input_ids, max_new_tokens=2048) # Example usage, adjust as necessary
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
print(generated_text)
- Downloads last month
- 70