Vision Test with llama cpp

#8
by Mad87d - opened

How can i Test If it works?

from llama_cpp import Llama

Modell laden

llm = Llama(
model_path="models/unsloth-mistral-3.2-24b-vision.Q5_K_M.gguf", # Passe den Pfad ggf. an!
n_gpu_layers=40, # Je nach GPU, sonst 0 für CPU
verbose=True,
)

Prompt mit Bild

prompt = "<|im_start|>user\n\nWas ist auf diesem Bild?\n<|im_end|>"

Ergebnis generieren

result = llm(
prompt,
images=["testbild.jpg"], # Passe Bildname/Pfad an!
max_tokens=512,
temperature=0.2,
)

Ergebnis anzeigen

print(result["choices"][0]["text"])
Something Like this?

Sign up or log in to comment