Instructions to use RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50") model = AutoModelForCausalLM.from_pretrained("RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50
- SGLang
How to use RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50 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 "RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50" \ --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": "RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50", "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 "RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50" \ --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": "RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50 with Docker Model Runner:
docker model run hf.co/RedHatAI/Llama-2-7b-evol-code-alpaca-pruned_50
Update README.md
#1
by abhinavnmagic - opened
README.md
CHANGED
|
@@ -49,11 +49,12 @@ Model evaluation metrics and results.
|
|
| 49 |
|
| 50 |
| Benchmark | Metric | Llama-2-7b-evolcodealpaca | Llama-2-7b-pruned50-retrained-evolcodealpaca |
|
| 51 |
|------------------------------------------------|---------------|-------------|-------------------------------|
|
| 52 |
-
| [HumanEval](https://arxiv.org/abs/2107.03374) | pass@1 |
|
| 53 |
|
| 54 |
## Model Training Details
|
| 55 |
|
| 56 |
-
|
|
|
|
| 57 |
|
| 58 |
## Help
|
| 59 |
|
|
|
|
| 49 |
|
| 50 |
| Benchmark | Metric | Llama-2-7b-evolcodealpaca | Llama-2-7b-pruned50-retrained-evolcodealpaca |
|
| 51 |
|------------------------------------------------|---------------|-------------|-------------------------------|
|
| 52 |
+
| [HumanEval](https://arxiv.org/abs/2107.03374) | pass@1 | 32.03 | 32.7 |
|
| 53 |
|
| 54 |
## Model Training Details
|
| 55 |
|
| 56 |
+
This model was obtained by sparse-tranfer of the sparse foundational model [Llama-2-7b-pruned50-retrained](https://huggingface.co/neuralmagic/Llama-2-7b-pruned50-retrained) on 60% of the [evolcodealpaca](https://huggingface.co/datasets/theblackcat102/evol-codealpaca-v1) dataset.
|
| 57 |
+
Training was perfomerd for 2 epochs and used the [SquareHead](https://arxiv.org/abs/2310.06927) knowledge distillation with [Llama-2-7b-evolcodealpaca](https://huggingface.co/neuralmagic/Llama-2-7b-evolcodealpaca) as teacher.
|
| 58 |
|
| 59 |
## Help
|
| 60 |
|