Guide for anybody wanting to use this with ollama

#1
by khronex - opened

Firstly, absolutely love your work.

Just thought i'd post this here to make it easier for anybody to play around and test this locally. This is windows based, but the steps are basically the same on linux.

Step 1.
Download the repo contents to a folder, this can be done manually or using a command similar to below if you have the huggingface-cli installed:

Huggingface-cli, edit local-dir to change download location:

huggingface-cli download fancyfeast/llama-bigasp-prompt-enhancer --local-dir "C:\llama-bigasp-prompt-enhancer\"

Step 2.
in the folder with the modelfiles you just downloaded create a new file named "modelfile" or "modelfile.txt" and add the following to it

edit the FROM line if you used a different folder.

FROM C:\llama-bigasp-prompt-enhancer\

PARAMETER temperature 0.6
PARAMETER num_ctx 4096
PARAMETER stop "<|start_header_id|>"
PARAMETER stop "<|end_header_id|>"
PARAMETER stop "<|eot_id|>"
PARAMETER top_p 0.9
PARAMETER num_predict 512

SYSTEM """You are a helpful image generation prompt writing AI. You write image generation prompts based on user requests. The prompt you write should be 150 words or longer."""

Step 3.
Go into your terminal/command prompt and cd into the directory that contains the model files
(shortcut: in windows you can simply go into that folder in explorer and then just type "cmd" into the address bar)

To import it and convert it to a Q8 quantized model:

ollama create --quantize q8_0 llama-bigasp-prompt-enhancer-q8

To import it and convert it to a Q4 k-means quantized model:

ollama create --quantize q4_K_M llama-bigasp-prompt-enhancer-q4km

Step 4.
Enjoy, now you can use the model with ollama, in comfyui using anything that works with ollama and in tools like open-webui

❤️

Thanks for your guide, I didn't know ollama can quantize directly, I've been using llamacpp.

I have a question, from what I understand this quantizes the safetensor model in this repo and that should be enough. But in the Llama Bigasp Prompt Enhancer space files section there's a lora_model folder with some other safetensors model inside it.

What is that LoRA? Is it something to be used?

Sign up or log in to comment