Open-Orca/OpenOrca
Viewer • Updated • 2.94M • 19.4k • 1.58k
How to use NewstaR/Porpoise-6b-instruct with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="NewstaR/Porpoise-6b-instruct", trust_remote_code=True) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("NewstaR/Porpoise-6b-instruct", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("NewstaR/Porpoise-6b-instruct", trust_remote_code=True, device_map="auto")How to use NewstaR/Porpoise-6b-instruct with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "NewstaR/Porpoise-6b-instruct"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "NewstaR/Porpoise-6b-instruct",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/NewstaR/Porpoise-6b-instruct
How to use NewstaR/Porpoise-6b-instruct with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "NewstaR/Porpoise-6b-instruct" \
--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": "NewstaR/Porpoise-6b-instruct",
"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 "NewstaR/Porpoise-6b-instruct" \
--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": "NewstaR/Porpoise-6b-instruct",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use NewstaR/Porpoise-6b-instruct with Docker Model Runner:
docker model run hf.co/NewstaR/Porpoise-6b-instruct
This model is a finetuned version of the DeciLM-6b-instruct on the Dolphin GPT4 Dataset
Please set naive_attention_prefill to true when loading this model.
Example:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, AutoTokenizer
model_name = "NewstaR/Porpoise-6b-instruct"
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16,
)
model = AutoModelForCausalLM.from_pretrained(
model_name,
quantization_config=bnb_config,
trust_remote_code=True,
naive_attention_prefill=True,
)
model.config.use_cache = False