https://www.gpu-mart.com/blog/custom-ll ... -modelfile
ollama show llama2:latest --modelfile
ollama show llama2:latest --modelfile > myllama2.modelfile
Use any text or code editing tool,open and modify the system prompt and template in the model file to suit your preferences or requirements:
PARAMETER temperature 1
PARAMETER num_ctx 4096
SYSTEM """You are Mario from super mario bros acting as an assistant"""
ollama create myllama2 --file myllama2.modelfile
ollama list
Ollama Modelfile
- Antonio Linares
- Site Admin
- Posts: 42475
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 25 times
- Been thanked: 62 times
- Contact:
- Antonio Linares
- Site Admin
- Posts: 42475
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 25 times
- Been thanked: 62 times
- Contact:
Re: Ollama Modelfile
# Después del entrenamiento, fusiona el adaptador con el modelo base
model = model.merge_and_unload() # Unir LoRA al modelo base
model.save_pretrained("merged_model") # Guardar modelo fusionado
tokenizer.save_pretrained("merged_model")
# Requiere llama.cpp instalado
python3 llama.cpp/convert-hf-to-gguf.py merged_model/ \
--outtype f16 \
--outfile qwen2.5-3b-instruct-merged.gguf
Modelfile
ollama create my-model -f Modelfile
ollama run my-model
model = model.merge_and_unload() # Unir LoRA al modelo base
model.save_pretrained("merged_model") # Guardar modelo fusionado
tokenizer.save_pretrained("merged_model")
# Requiere llama.cpp instalado
python3 llama.cpp/convert-hf-to-gguf.py merged_model/ \
--outtype f16 \
--outfile qwen2.5-3b-instruct-merged.gguf
Modelfile
Code: Select all | Expand
FROM ./qwen2.5-3b-instruct-merged.gguf
PARAMETER temperature 0.8
PARAMETER num_ctx 1024
ollama run my-model