Text Generation
Transformers
Safetensors
English
mistral
sparse
pruned
wanda
conversational
text-generation-inference
Instructions to use kettleguts/zephyr-7b-beta_sparse05 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kettleguts/zephyr-7b-beta_sparse05 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kettleguts/zephyr-7b-beta_sparse05") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kettleguts/zephyr-7b-beta_sparse05") model = AutoModelForCausalLM.from_pretrained("kettleguts/zephyr-7b-beta_sparse05", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kettleguts/zephyr-7b-beta_sparse05 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kettleguts/zephyr-7b-beta_sparse05" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kettleguts/zephyr-7b-beta_sparse05", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kettleguts/zephyr-7b-beta_sparse05
- SGLang
How to use kettleguts/zephyr-7b-beta_sparse05 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 "kettleguts/zephyr-7b-beta_sparse05" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kettleguts/zephyr-7b-beta_sparse05", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "kettleguts/zephyr-7b-beta_sparse05" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kettleguts/zephyr-7b-beta_sparse05", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use kettleguts/zephyr-7b-beta_sparse05 with Docker Model Runner:
docker model run hf.co/kettleguts/zephyr-7b-beta_sparse05
Update README.md
Browse files
README.md
CHANGED
|
@@ -15,6 +15,7 @@ language:
|
|
| 15 |
|
| 16 |
# Model Card for kettleguts/zephyr-7b-beta_sparse05
|
| 17 |
|
|
|
|
| 18 |
This is a pruned version of HuggingFaceH4/zephyr-7b-beta found [here](https://huggingface.co/HuggingFaceH4/zephyr-7b-beta). Wanda pruning was used to introduce 50% sparsity into the linear layers. Read the paper [here](https://arxiv.org/abs/2306.11695).
|
| 19 |
|
| 20 |
|
|
@@ -41,7 +42,7 @@ This model should never be used for critical decisions involving health, life, e
|
|
| 41 |
|
| 42 |
## Bias, Risks, and Limitations
|
| 43 |
|
| 44 |
-
[No
|
| 45 |
|
| 46 |
## How to Get Started with the Model
|
| 47 |
|
|
@@ -88,7 +89,7 @@ Output:
|
|
| 88 |
Pending
|
| 89 |
|
| 90 |
|
| 91 |
-
## Model Examination
|
| 92 |
|
| 93 |
<!-- Relevant interpretability work for the model goes here -->
|
| 94 |
Pending
|
|
@@ -97,7 +98,7 @@ Pending
|
|
| 97 |
|
| 98 |
The calculations necessary to prune this model required less than 1 hour of time on a T4 GPU in Colab.
|
| 99 |
|
| 100 |
-
## Technical Specifications
|
| 101 |
|
| 102 |
|
| 103 |
#### Software
|
|
@@ -105,7 +106,7 @@ The calculations necessary to prune this model required less than 1 hour of time
|
|
| 105 |
The bulk of this work was done using [Pytorch](https://pytorch.org/). They have an array of built-in [pruning tools](https://pytorch.org/docs/stable/nn.html#:~:text=Utility%20classes%20and%20functions%20for%20pruning%20Module%20parameters
|
| 106 |
) in torch.nn . Also check out the [tutorial](https://pytorch.org/tutorials/intermediate/pruning_tutorial.html) by [Michela Paganini](https://github.com/mickypaganini).
|
| 107 |
|
| 108 |
-
## Citation
|
| 109 |
|
| 110 |
**BibTeX:**
|
| 111 |
<code>
|
|
|
|
| 15 |
|
| 16 |
# Model Card for kettleguts/zephyr-7b-beta_sparse05
|
| 17 |
|
| 18 |
+
|
| 19 |
This is a pruned version of HuggingFaceH4/zephyr-7b-beta found [here](https://huggingface.co/HuggingFaceH4/zephyr-7b-beta). Wanda pruning was used to introduce 50% sparsity into the linear layers. Read the paper [here](https://arxiv.org/abs/2306.11695).
|
| 20 |
|
| 21 |
|
|
|
|
| 42 |
|
| 43 |
## Bias, Risks, and Limitations
|
| 44 |
|
| 45 |
+
[No safegaurds have been added to this model.](https://huggingface.co/HuggingFaceH4/zephyr-7b-beta#bias-risks-and-limitations)
|
| 46 |
|
| 47 |
## How to Get Started with the Model
|
| 48 |
|
|
|
|
| 89 |
Pending
|
| 90 |
|
| 91 |
|
| 92 |
+
## Model Examination
|
| 93 |
|
| 94 |
<!-- Relevant interpretability work for the model goes here -->
|
| 95 |
Pending
|
|
|
|
| 98 |
|
| 99 |
The calculations necessary to prune this model required less than 1 hour of time on a T4 GPU in Colab.
|
| 100 |
|
| 101 |
+
## Technical Specifications
|
| 102 |
|
| 103 |
|
| 104 |
#### Software
|
|
|
|
| 106 |
The bulk of this work was done using [Pytorch](https://pytorch.org/). They have an array of built-in [pruning tools](https://pytorch.org/docs/stable/nn.html#:~:text=Utility%20classes%20and%20functions%20for%20pruning%20Module%20parameters
|
| 107 |
) in torch.nn . Also check out the [tutorial](https://pytorch.org/tutorials/intermediate/pruning_tutorial.html) by [Michela Paganini](https://github.com/mickypaganini).
|
| 108 |
|
| 109 |
+
## Citation
|
| 110 |
|
| 111 |
**BibTeX:**
|
| 112 |
<code>
|