Instructions to use AshtonIsNotHere/CodeLlama_7B_nlp_pp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AshtonIsNotHere/CodeLlama_7B_nlp_pp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AshtonIsNotHere/CodeLlama_7B_nlp_pp")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AshtonIsNotHere/CodeLlama_7B_nlp_pp") model = AutoModelForCausalLM.from_pretrained("AshtonIsNotHere/CodeLlama_7B_nlp_pp") - llama-cpp-python
How to use AshtonIsNotHere/CodeLlama_7B_nlp_pp with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="AshtonIsNotHere/CodeLlama_7B_nlp_pp", filename="CodeLlama_7B_nlp_pp_q8_0.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use AshtonIsNotHere/CodeLlama_7B_nlp_pp with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf AshtonIsNotHere/CodeLlama_7B_nlp_pp:Q8_0 # Run inference directly in the terminal: llama-cli -hf AshtonIsNotHere/CodeLlama_7B_nlp_pp:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf AshtonIsNotHere/CodeLlama_7B_nlp_pp:Q8_0 # Run inference directly in the terminal: llama-cli -hf AshtonIsNotHere/CodeLlama_7B_nlp_pp:Q8_0
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf AshtonIsNotHere/CodeLlama_7B_nlp_pp:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf AshtonIsNotHere/CodeLlama_7B_nlp_pp:Q8_0
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf AshtonIsNotHere/CodeLlama_7B_nlp_pp:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf AshtonIsNotHere/CodeLlama_7B_nlp_pp:Q8_0
Use Docker
docker model run hf.co/AshtonIsNotHere/CodeLlama_7B_nlp_pp:Q8_0
- LM Studio
- Jan
- vLLM
How to use AshtonIsNotHere/CodeLlama_7B_nlp_pp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AshtonIsNotHere/CodeLlama_7B_nlp_pp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AshtonIsNotHere/CodeLlama_7B_nlp_pp", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AshtonIsNotHere/CodeLlama_7B_nlp_pp:Q8_0
- SGLang
How to use AshtonIsNotHere/CodeLlama_7B_nlp_pp 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 "AshtonIsNotHere/CodeLlama_7B_nlp_pp" \ --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": "AshtonIsNotHere/CodeLlama_7B_nlp_pp", "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 "AshtonIsNotHere/CodeLlama_7B_nlp_pp" \ --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": "AshtonIsNotHere/CodeLlama_7B_nlp_pp", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use AshtonIsNotHere/CodeLlama_7B_nlp_pp with Ollama:
ollama run hf.co/AshtonIsNotHere/CodeLlama_7B_nlp_pp:Q8_0
- Unsloth Studio new
How to use AshtonIsNotHere/CodeLlama_7B_nlp_pp with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for AshtonIsNotHere/CodeLlama_7B_nlp_pp to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for AshtonIsNotHere/CodeLlama_7B_nlp_pp to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for AshtonIsNotHere/CodeLlama_7B_nlp_pp to start chatting
- Docker Model Runner
How to use AshtonIsNotHere/CodeLlama_7B_nlp_pp with Docker Model Runner:
docker model run hf.co/AshtonIsNotHere/CodeLlama_7B_nlp_pp:Q8_0
- Lemonade
How to use AshtonIsNotHere/CodeLlama_7B_nlp_pp with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AshtonIsNotHere/CodeLlama_7B_nlp_pp:Q8_0
Run and chat with the model
lemonade run user.CodeLlama_7B_nlp_pp-Q8_0
List all available models
lemonade list
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("AshtonIsNotHere/CodeLlama_7B_nlp_pp")
model = AutoModelForCausalLM.from_pretrained("AshtonIsNotHere/CodeLlama_7B_nlp_pp")CodeLlama_7B_nlp_pp
This model is a fine-tuned version of codellama/CodeLlama-7b-hf on the AshtonIsNotHere/nlp_pp_code_dataset dataset. It achieves the following results on the evaluation set:
- Loss: 0.4129
- Accuracy: 0.8968
Model description
This model has been fine-tuned for code completion on a dataset of NLP++ code.
Intended uses & limitations
More information needed
Training and evaluation data
Dataset consists of a combination of scraped NLP++ code and NLP++ code examples from the VisualText website.
Training procedure
This model is trained in a multinode, multi-gpu setup with DeepSpeed Z3. For more information on the training setup, check out the GitHub repo.
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 0.00012
- train_batch_size: 1
- eval_batch_size: 1
- seed: 42
- distributed_type: multi-GPU
- num_devices: 4
- gradient_accumulation_steps: 4
- total_train_batch_size: 16
- total_eval_batch_size: 4
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_ratio: 0.1
- num_epochs: 7.0
Training results
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| No log | 1.0 | 61 | 0.5100 | 0.8726 |
| No log | 1.99 | 122 | 0.4129 | 0.8968 |
| No log | 2.99 | 183 | 0.4166 | 0.9072 |
| No log | 4.0 | 245 | 0.4595 | 0.9090 |
| No log | 5.0 | 306 | 0.5181 | 0.9093 |
| No log | 5.99 | 367 | 0.5553 | 0.9090 |
| No log | 6.97 | 427 | 0.5603 | 0.9089 |
Framework versions
- Transformers 4.30.2
- Pytorch 2.0.1+cu117
- Datasets 2.13.0
- Tokenizers 0.13.3
- Downloads last month
- 879
8-bit
Dataset used to train AshtonIsNotHere/CodeLlama_7B_nlp_pp
Space using AshtonIsNotHere/CodeLlama_7B_nlp_pp 1
Evaluation results
- Accuracy on AshtonIsNotHere/nlp_pp_code_datasettest set self-reported0.897
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AshtonIsNotHere/CodeLlama_7B_nlp_pp")