Views
No views yet
convert-hf-to-gguf.py script from the llama.cpp repository.git clone https://github.com/ggerganov/llama.cpp.gitpip install -r llama.cpp/requirements.txtpython llama.cpp/convert-hf-to-gguf-update.py -hpython llama.cpp/convert-hf-to-gguf-update.py ./models/8B/Meta-Llama-3-8B-Instruct --outfile Llama3-8B-instruct-Q8.0.gguf --outtype q8_0huggingface_hub library installed (pip install huggingface_hub)upload_gguf_model.py:1from huggingface_hub import HfApi
2
3def push_to_hub(hf_token, local_path, model_id):
4 api = HfApi(token=hf_token)
5 api.create_repo(model_id, exist_ok=True, repo_type="model")
6
7 api.upload_file(
8 path_or_fileobj=local_path,
9 path_in_repo="Meta-Llama-3-8B-Instruct.bf16.gguf",
10 repo_id=model_id
11 )
12
13 print(f"Model successfully pushed to {model_id}")
14
15# Example usage
16hf_token = "your_huggingface_token_here"
17local_path = "/path/to/your/local/model/directory"
18model_id = "your-username/your-model-name"
19
20push_to_hub(hf_token, local_path, model_id)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 Facepython upload_gguf_model.pyREADME.md file with your model, detailing its architecture, quantization, and usage instructions.config.json file with model configuration details.