mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-27 18:48:22 +03:00
Set model
This commit is contained in:
parent
f3cda9020b
commit
88bad3423b
@ -138,7 +138,10 @@ class LlamaCppClient(GenAIClient):
|
|||||||
elif tool_choice == "required":
|
elif tool_choice == "required":
|
||||||
openai_tool_choice = "required"
|
openai_tool_choice = "required"
|
||||||
|
|
||||||
payload: dict[str, Any] = {"messages": messages, "model": self.genai_config.model}
|
payload: dict[str, Any] = {
|
||||||
|
"messages": messages,
|
||||||
|
"model": self.genai_config.model,
|
||||||
|
}
|
||||||
if stream:
|
if stream:
|
||||||
payload["stream"] = True
|
payload["stream"] = True
|
||||||
if tools:
|
if tools:
|
||||||
@ -223,15 +226,17 @@ class LlamaCppClient(GenAIClient):
|
|||||||
to_encode = jpeg_bytes if jpeg_bytes is not None else img
|
to_encode = jpeg_bytes if jpeg_bytes is not None else img
|
||||||
encoded = base64.b64encode(to_encode).decode("utf-8")
|
encoded = base64.b64encode(to_encode).decode("utf-8")
|
||||||
# prompt_string must contain <__media__> placeholder for image tokenization
|
# prompt_string must contain <__media__> placeholder for image tokenization
|
||||||
content.append({
|
content.append(
|
||||||
"prompt_string": "<__media__>\n",
|
{
|
||||||
"multimodal_data": [encoded],
|
"prompt_string": "<__media__>\n",
|
||||||
})
|
"multimodal_data": [encoded],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
f"{self.provider}/embeddings",
|
f"{self.provider}/embeddings",
|
||||||
json={"content": content},
|
json={"model": self.genai_config.model, "content": content},
|
||||||
timeout=self.timeout,
|
timeout=self.timeout,
|
||||||
)
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user