Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

microsoft
/
Orca-2-7b

Text Generation
Transformers
PyTorch
llama
orca
orca2
microsoft
text-generation-inference
Model card Files Files and versions
xet
Community
20

Instructions to use microsoft/Orca-2-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use microsoft/Orca-2-7b with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="microsoft/Orca-2-7b")
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    tokenizer = AutoTokenizer.from_pretrained("microsoft/Orca-2-7b")
    model = AutoModelForCausalLM.from_pretrained("microsoft/Orca-2-7b")
  • Inference
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • vLLM

    How to use microsoft/Orca-2-7b with vLLM:

    Install from pip and serve model
    # Install vLLM from pip:
    pip install vllm
    # Start the vLLM server:
    vllm serve "microsoft/Orca-2-7b"
    # Call the server using curl (OpenAI-compatible API):
    curl -X POST "http://localhost:8000/v1/completions" \
    	-H "Content-Type: application/json" \
    	--data '{
    		"model": "microsoft/Orca-2-7b",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
    Use Docker
    docker model run hf.co/microsoft/Orca-2-7b
  • SGLang

    How to use microsoft/Orca-2-7b 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 "microsoft/Orca-2-7b" \
        --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": "microsoft/Orca-2-7b",
    		"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 "microsoft/Orca-2-7b" \
            --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": "microsoft/Orca-2-7b",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use microsoft/Orca-2-7b with Docker Model Runner:

    docker model run hf.co/microsoft/Orca-2-7b

Update README.md

#2
by hamidpalangi - opened Nov 17, 2023
base: refs/heads/main
←
from: refs/pr/2
Discussion Files changed
+10
-28
initial commit2f8bc6e6
Create README.md3926aabe
Upload folder using huggingface_hube64833ea
Delete config.json~19cfaa78
Delete pytorch_model.bind000614a
Upload folder using huggingface_hubdd4e63c9
Update generation_config.jsond800ca02
Update README.md75529455
Update README.mdb7e6b060
Update README.mdd5bfb8ea
Update README.md1357c228
Update README.mddab8b0c9
Update README.mda9cadf26
Update README.md19145f2c
Update README.mdc129b166
Update README.md32b879de
Update README.mda053bdda
Update README.md3440dbd3
Update README.mdaaeb938f
Update README.md6443eb11
Update README.mddd63beb3
Upload Noticec5f603a4
Upload LICENSE9aba364a
update the example for "Inference with Hugging Face library" (#1)0a82d0d5
hamidpalangi
Nov 17, 2023
No description provided.
Update README.md8712ba2b
zhenggq changed pull request status to merged Nov 17, 2023

· Sign up or log in to comment

Company
TOS Privacy About Careers
Website
Models Datasets Spaces Pricing Docs