Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

LiamCarter
/
blockpruner_llama2-7b_ratio0.5_original_nonstrict

Text Generation
Transformers
PyTorch
llama
llama-2
blockpruner
pruning
structured-pruning
original-checkpoint
non-strict-parameter-budget
text-generation-inference
Model card Files Files and versions
xet
Community

Instructions to use LiamCarter/blockpruner_llama2-7b_ratio0.5_original_nonstrict with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • Transformers

    How to use LiamCarter/blockpruner_llama2-7b_ratio0.5_original_nonstrict with Transformers:

    # Use a pipeline as a high-level helper
    from transformers import pipeline
    
    pipe = pipeline("text-generation", model="LiamCarter/blockpruner_llama2-7b_ratio0.5_original_nonstrict")
    # Load model directly
    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    tokenizer = AutoTokenizer.from_pretrained("LiamCarter/blockpruner_llama2-7b_ratio0.5_original_nonstrict")
    model = AutoModelForCausalLM.from_pretrained("LiamCarter/blockpruner_llama2-7b_ratio0.5_original_nonstrict", device_map="auto")
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps Settings
  • vLLM

    How to use LiamCarter/blockpruner_llama2-7b_ratio0.5_original_nonstrict with vLLM:

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

    How to use LiamCarter/blockpruner_llama2-7b_ratio0.5_original_nonstrict 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 "LiamCarter/blockpruner_llama2-7b_ratio0.5_original_nonstrict" \
        --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": "LiamCarter/blockpruner_llama2-7b_ratio0.5_original_nonstrict",
    		"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 "LiamCarter/blockpruner_llama2-7b_ratio0.5_original_nonstrict" \
            --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": "LiamCarter/blockpruner_llama2-7b_ratio0.5_original_nonstrict",
    		"prompt": "Once upon a time,",
    		"max_tokens": 512,
    		"temperature": 0.5
    	}'
  • Docker Model Runner

    How to use LiamCarter/blockpruner_llama2-7b_ratio0.5_original_nonstrict with Docker Model Runner:

    docker model run hf.co/LiamCarter/blockpruner_llama2-7b_ratio0.5_original_nonstrict
blockpruner_llama2-7b_ratio0.5_original_nonstrict
7.14 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 2 commits
LiamCarter's picture
LiamCarter
Add files using upload-large-folder tool
4218bed verified about 1 month ago
  • .gitattributes
    1.52 kB
    initial commit about 1 month ago
  • LICENSE.txt
    7.02 kB
    Add files using upload-large-folder tool about 1 month ago
  • NOTICE
    113 Bytes
    Add files using upload-large-folder tool about 1 month ago
  • README.md
    4.08 kB
    Add files using upload-large-folder tool about 1 month ago
  • USE_POLICY.md
    4.77 kB
    Add files using upload-large-folder tool about 1 month ago
  • blockpruner_config.json
    1.46 kB
    Add files using upload-large-folder tool about 1 month ago
  • config.json
    2.44 kB
    Add files using upload-large-folder tool about 1 month ago
  • generation_config.json
    183 Bytes
    Add files using upload-large-folder tool about 1 month ago
  • pytorch_model-00001-of-00002.bin
    4.94 GB
    xet
    Add files using upload-large-folder tool about 1 month ago
  • pytorch_model-00002-of-00002.bin
    2.2 GB
    xet
    Add files using upload-large-folder tool about 1 month ago
  • pytorch_model.bin.index.json
    12 kB
    Add files using upload-large-folder tool about 1 month ago
  • special_tokens_map.json
    414 Bytes
    Add files using upload-large-folder tool about 1 month ago
  • tokenizer.json
    1.84 MB
    Add files using upload-large-folder tool about 1 month ago
  • tokenizer_config.json
    918 Bytes
    Add files using upload-large-folder tool about 1 month ago