mirror of
https://github.com/Ladebeze66/llm_lab.git
synced 2025-12-15 19:26:52 +01:00
29 lines
751 B
Python
29 lines
751 B
Python
from core.factory import LLMFactory
|
|
from agents.roles import AGENTS
|
|
import sys
|
|
import os
|
|
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
|
|
|
# Cas d'utilisation : analyse uniquement visuelle
|
|
role = "diagnostic_assistant"
|
|
prompt = "What do you see in the attached screenshot? Describe the main elements."
|
|
image_path = ["images/error_screenshot.png"]
|
|
custom_params = {
|
|
"temperature": 0.3,
|
|
"top_p": 1.0,
|
|
"format": "json"
|
|
}
|
|
|
|
model = LLMFactory.create("llama3.2-vision:90b")
|
|
model.set_role(role, AGENTS[role])
|
|
model.params.update(custom_params)
|
|
|
|
response_en, response_fr = model.generate(
|
|
user_prompt=prompt,
|
|
images=image_path,
|
|
translate=True
|
|
)
|
|
|
|
print("[EN]", response_en)
|
|
print("[FR]", response_fr)
|