FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index latest AI news Ollama Modelfile
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Ollama Modelfile
Posted: Sat Feb 08, 2025 05:11 PM
https://www.gpu-mart.com/blog/custom-llm-models-with-ollama-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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ollama Modelfile
Posted: Sat Feb 08, 2025 09:42 PM
# 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
FROM ./qwen2.5-3b-instruct-merged.gguf
PARAMETER temperature 0.8
PARAMETER num_ctx 1024
ollama create my-model -f Modelfile
ollama run my-model
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion