Downloads · 30 days
40
1% of all-time downloads
epsilondelta1982/Meta-llama3-8b-instruct-GGUF
Meta-llama3-8b-instruct-GGUF is a machine learning model from epsilondelta1982. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
This guide explains what GGUF models are, how to convert models to GGUF format, and how to upload them to the Hugging Face Hub.
Downloads · 30 days
40
1% of all-time downloads
All-time downloads
3.1K
Public
Repo size
36.8 GB
Likes
0
Public
Click a slice to open those files.
.gguf36.8 GB · 100%
From the Hugging Face model README
This guide explains what GGUF models are, how to convert models to GGUF format, and how to upload them to the Hugging Face Hub.
GGUF (GGML Unified Format) is a file format for storing large language models, particularly optimized for efficient inference on consumer hardware. Key features of GGUF models include:
Converting models to GGUF format offers several advantages:
To convert a model to GGUF format, we'll use the convert-hf-to-gguf.py script from the llama.cpp repository.
Clone the llama.cpp repository:
git clone https://github.com/ggerganov/llama.cpp.git
Install required Python libraries:
pip install -r llama.cpp/requirements.txt
Verify the script and understand options:
python llama.cpp/convert-hf-to-gguf-update.py -h
Convert the HuggingFace model to GGUF:
python llama.cpp/convert-hf-to-gguf-update.py ./models/8B/Meta-Llama-3-8B-Instruct --outfile Llama3-8B-instruct-Q8.0.gguf --outtype q8_0
This command converts the model to 8-bit quantization (q8_0). You can choose different quantization levels like int4, int8, or keep it in f16 or f32 format.
Once you have your GGUF model, you can upload it to Hugging Face for easy sharing and versioning.
huggingface_hub library installed (pip install huggingface_hub)Save the following script as upload_gguf_model.py:
from huggingface_hub import HfApi
def push_to_hub(hf_token, local_path, model_id):
api = HfApi(token=hf_token)
api.create_repo(model_id, exist_ok=True, repo_type="model")
api.upload_file(
path_or_fileobj=local_path,
path_in_repo="Meta-Llama-3-8B-Instruct.bf16.gguf",
repo_id=model_id
)
print(f"Model successfully pushed to {model_id}")
# Example usage
hf_token = "your_huggingface_token_here"
local_path = "/path/to/your/local/model/directory"
model_id = "your-username/your-model-name"
push_to_hub(hf_token, local_path, model_id)
Replace the placeholder values in the script:
your_huggingface_token_here: Your Hugging Face API token/path/to/your/local/model/directory: The local path to your GGUF model filesyour-username/your-model-name: Your desired model ID on Hugging FaceRun the script:
python upload_gguf_model.py
README.md file with your model, detailing its architecture, quantization, and usage instructions.config.json file with model configuration details.For more detailed information and updates, please refer to the official documentation of llama.cpp and Hugging Face.