some changes
This commit is contained in:
1 parent
cccdb7d231
commit
a3700ca15a
7 files changed
+36
-12
No files matched your search
@@ -5,6 +5,11 @@ from sqlalchemy.sql.expression import select
|
|||||||
from tortoise import fields, models, Tortoise
|
from tortoise import fields, models, Tortoise
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
|
# These types don't represent all objects in Horde.
|
||||||
|
# Agents and Chats can be created for just a session, in which case, they
|
||||||
|
# are not saved on the database, as aren't all their associated values of
|
||||||
|
# other classes.
|
||||||
|
|
||||||
class Base(DeclarativeBase):
|
class Base(DeclarativeBase):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import threading
|
import threading
|
||||||
|
import ollama
|
||||||
from stream import Stream
|
from stream import Stream
|
||||||
|
|
||||||
|
|
||||||
@@ -18,13 +19,15 @@ class Models:
|
|||||||
qwen3_8b = "lucataco/qwen3-vl-8b-instruct:39e893666996acf464cff75688ad49ac95ef54e9f1c688fbc677330acc478e11"
|
qwen3_8b = "lucataco/qwen3-vl-8b-instruct:39e893666996acf464cff75688ad49ac95ef54e9f1c688fbc677330acc478e11"
|
||||||
qwen3_235b = "qwen/qwen3-235b-a22b-instruct-2507"
|
qwen3_235b = "qwen/qwen3-235b-a22b-instruct-2507"
|
||||||
|
|
||||||
async def ollama_chat_completion(app, messages, model, opts={}):
|
async def ollama_list(app, messages, model, opts={}):
|
||||||
from ollama import AsyncClient
|
# TODO: test the output, and use this
|
||||||
|
return ollama.list()
|
||||||
|
|
||||||
|
async def ollama_chat_completion(app, messages, model, opts={}):
|
||||||
content_stream = Stream(app)
|
content_stream = Stream(app)
|
||||||
|
|
||||||
print("START OLLAMA INFERENCE")
|
print("START OLLAMA INFERENCE")
|
||||||
stream_response = await AsyncClient().chat(
|
stream_response = await ollama.AsyncClient().chat(
|
||||||
model=model,
|
model=model,
|
||||||
messages=[{'role': msg.role, 'content': msg.content} for msg in messages],
|
messages=[{'role': msg.role, 'content': msg.content} for msg in messages],
|
||||||
stream=True,
|
stream=True,
|
||||||
|
|||||||
@@ -133,6 +133,12 @@ def start_server(app):
|
|||||||
body = req.get('body', {})
|
body = req.get('body', {})
|
||||||
nonce = req.get('nonce', None)
|
nonce = req.get('nonce', None)
|
||||||
|
|
||||||
|
def get_agent_id ():
|
||||||
|
raise Exception("Cannot get agent id")
|
||||||
|
|
||||||
|
def get_chat_id ():
|
||||||
|
raise Exception("Cannot get chat id")
|
||||||
|
|
||||||
if action == "ping":
|
if action == "ping":
|
||||||
await send({'message': "pong"})
|
await send({'message': "pong"})
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
|
|
||||||
--border-radius: 6px;
|
--border-radius: 6px;
|
||||||
--section-gap: 160px;
|
--section-gap: 160px;
|
||||||
|
--header-height: 4em;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Z-Index hierarchy */
|
/* Z-Index hierarchy */
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.main-header {
|
.main-header {
|
||||||
height: 3em;
|
height: var(--header-height);
|
||||||
border-bottom: 1px solid var(--color-border);
|
border-bottom: 1px solid var(--color-border);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|||||||
@@ -8,8 +8,9 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<header class="main-header">
|
<header class="main-header">
|
||||||
<button class="when-sidebar-collapsed" @click="sidebarExpand()">
|
<button class="header-button when-sidebar-collapsed" @click="sidebarExpand()">
|
||||||
>>
|
>>
|
||||||
|
<!--i class="fa-solid fa-angles-right"></i-->
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<slot>
|
<slot>
|
||||||
@@ -25,4 +26,11 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
padding: 0 0.4em;
|
padding: 0 0.4em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.header-button {
|
||||||
|
height: var(--header-height);
|
||||||
|
width: var(--header-height);
|
||||||
|
background-color: none;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -92,8 +92,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-group">
|
<div class="tab-group">
|
||||||
<button class="header-button">
|
<button class="header-button" @click="sidebarExpanded=false;">
|
||||||
<i class="fa-solid fa-angles-left" @click="sidebarExpanded=false;"></i>
|
<!--i class="fa-solid fa-angles-left"></i-->
|
||||||
|
<<
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -124,8 +125,8 @@
|
|||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
height: 3em;
|
height: var(--header-height);
|
||||||
width: 3em;
|
width: var(--header-height);
|
||||||
|
|
||||||
padding-top: 3px;
|
padding-top: 3px;
|
||||||
color: var(--color-text-mute);
|
color: var(--color-text-mute);
|
||||||
@@ -193,9 +194,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.header-button {
|
.header-button {
|
||||||
height: 3em;
|
height: var(--header-height);
|
||||||
width: 3em;
|
width: var(--header-height);
|
||||||
border-radius: 1.5em;
|
/*border-radius: 1.5em;*/
|
||||||
background-color: none;
|
background-color: none;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user