Buckets:
| # Ejecución con llama.cpp | |
| Este documento describe cómo preparar un modelo MarsLM para ejecutar con llama.cpp. | |
| ## 1. Requisitos | |
| - `llama.cpp` compilado en Windows. | |
| - `python` instalado. | |
| - Un checkpoint de MarsLM entrenado en `artifacts/checkpoints/marslm-final.pt`. | |
| - Un tokenizador compatible: `artifacts/tokenizer/marslm.json`. | |
| ## 2. Exportar a GGUF | |
| Si deseas una exportación de metadatos GGUF para integración con llama.cpp / Ollama, usa: | |
| ```powershell | |
| python quantization/export_gguf.py --model-path artifacts/checkpoints/marslm-final.pt --config artifacts/checkpoints/config.json --output artifacts/quantized/marslm --quant-type gguf --output-format gguf | |
| ``` | |
| Esto escribirá un stub GGUF en `artifacts/quantized/marslm.gguf`. | |
| ## 3. Exportar pesos INT8 / INT4 | |
| El script también produce payloads cuantizados. | |
| INT8: | |
| ```powershell | |
| python quantization/export_gguf.py --model-path artifacts/checkpoints/marslm-final.pt --config artifacts/checkpoints/config.json --output artifacts/quantized/marslm_int8 --quant-type int8 --output-format pt | |
| ``` | |
| INT4 (base para Q4/Q5): | |
| ```powershell | |
| python quantization/export_gguf.py --model-path artifacts/checkpoints/marslm-final.pt --config artifacts/checkpoints/config.json --output artifacts/quantized/marslm_int4 --quant-type int4 --output-format pt | |
| ``` | |
| Q4/Q5 stub: | |
| ```powershell | |
| python quantization/export_gguf.py --model-path artifacts/checkpoints/marslm-final.pt --config artifacts/checkpoints/config.json --output artifacts/quantized/marslm_q4_1 --quant-type q4_1 --output-format gguf | |
| ``` | |
| ## 4. Uso con llama.cpp | |
| Una vez que tengas los pesos cuantizados y el stub GGUF, usa el comando de `llama.cpp` para cargar el modelo. | |
| ```powershell | |
| .in | |
| eleasein ext-generation.exe ^ | |
| --model artifacts\quantized\marslm_q4_1.gguf ^ | |
| --prompt "Hola, escribe un poema corto en español." ^ | |
| --n_predict 128 | |
| ``` | |
| > Nota: esta guía asume que `llama.cpp` puede aceptar el stub GGUF y los pesos en el formato generado. Si `llama.cpp` requiere un conversor adicional, usa `python export/export.py --format gguf` o un conversor de terceros para crear el archivo final compatible. | |
| ## 5. Observaciones | |
| - La cuantización INT4 aquí es una aproximación de carga y requiere un convertidor específico si quieres un `.gguf` plenamente compatible. | |
| - Para peso real Q4/Q5, llama.cpp generalmente usa conversores binarios especializados que ajustan la representación de las matrices. | |
| - Usa el stub GGUF como base de integración cuando no exista un convertidor directo. | |
Xet Storage Details
- Size:
- 2.57 kB
- Xet hash:
- f936467f4278e86743983811a814852284f61aa54d68bee4203933a60a3ddb1f
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.