Spaces:
Paused
Paused
Create model_card_template_gguf.md
Browse files- model_card_template_gguf.md +64 -0
model_card_template_gguf.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- amop-optimized
|
| 5 |
+
- gguf
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
# AMOP-Optimized GGUF Model: {repo_name}
|
| 9 |
+
|
| 10 |
+
This model was automatically optimized for CPU inference using the **Adaptive Model Optimization Pipeline (AMOP)**.
|
| 11 |
+
|
| 12 |
+
- **Base Model:** [{model_id}](https://huggingface.co/{model_id})
|
| 13 |
+
- **Optimization Date:** {optimization_date}
|
| 14 |
+
|
| 15 |
+
## Optimization Details
|
| 16 |
+
|
| 17 |
+
The following AMOP GGUF pipeline stages were applied:
|
| 18 |
+
- **GGUF Conversion & Quantization:** Enabled (Strategy: {quant_type})
|
| 19 |
+
|
| 20 |
+
## How to Use
|
| 21 |
+
|
| 22 |
+
This model is in GGUF format and can be run with libraries like `llama-cpp-python`.
|
| 23 |
+
|
| 24 |
+
First, install the necessary libraries:
|
| 25 |
+
```bash
|
| 26 |
+
pip install llama-cpp-python
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
Then, use the following Python code to run inference:
|
| 30 |
+
```python
|
| 31 |
+
from llama_cpp import Llama
|
| 32 |
+
from huggingface_hub import hf_hub_download
|
| 33 |
+
|
| 34 |
+
# Download the GGUF model from the Hub
|
| 35 |
+
model_path = hf_hub_download(
|
| 36 |
+
repo_id="{repo_id}",
|
| 37 |
+
filename="model.gguf" # Or the specific GGUF file name
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
# Instantiate the model
|
| 41 |
+
llm = Llama(
|
| 42 |
+
model_path=model_path,
|
| 43 |
+
n_ctx=2048, # Context window
|
| 44 |
+
)
|
| 45 |
+
|
| 46 |
+
# Run inference
|
| 47 |
+
prompt = "The future of AI is"
|
| 48 |
+
output = llm(
|
| 49 |
+
f"Q: {prompt} A: ", # Or your preferred prompt format
|
| 50 |
+
max_tokens=50,
|
| 51 |
+
stop=["Q:", "\n"],
|
| 52 |
+
echo=True
|
| 53 |
+
)
|
| 54 |
+
|
| 55 |
+
print(output)
|
| 56 |
+
```
|
| 57 |
+
## AMOP Pipeline Log
|
| 58 |
+
<details>
|
| 59 |
+
<summary>Click to expand</summary>
|
| 60 |
+
|
| 61 |
+
```
|
| 62 |
+
{pipeline_log}
|
| 63 |
+
```
|
| 64 |
+
</details>
|