Commit 995f7bc5 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

fix: chat completed

parent e1d65065
...@@ -271,6 +271,11 @@ class PipelineMiddleware(BaseHTTPMiddleware): ...@@ -271,6 +271,11 @@ class PipelineMiddleware(BaseHTTPMiddleware):
except: except:
pass pass
model = app.state.MODELS[model_id]
if "pipeline" in model:
sorted_filters.append(model)
for filter in sorted_filters: for filter in sorted_filters:
r = None r = None
try: try:
...@@ -490,6 +495,11 @@ async def chat_completed(form_data: dict, user=Depends(get_verified_user)): ...@@ -490,6 +495,11 @@ async def chat_completed(form_data: dict, user=Depends(get_verified_user)):
] ]
sorted_filters = sorted(filters, key=lambda x: x["pipeline"]["priority"]) sorted_filters = sorted(filters, key=lambda x: x["pipeline"]["priority"])
model = app.state.MODELS[model_id]
if "pipeline" in model:
sorted_filters = [model] + sorted_filters
for filter in sorted_filters: for filter in sorted_filters:
r = None r = None
try: try:
......
...@@ -899,7 +899,7 @@ ...@@ -899,7 +899,7 @@
const messages = createMessagesList(responseMessageId); const messages = createMessagesList(responseMessageId);
const res = await chatCompleted(localStorage.token, { const res = await chatCompleted(localStorage.token, {
model: model, model: model.id,
messages: messages.map((m) => ({ messages: messages.map((m) => ({
id: m.id, id: m.id,
role: m.role, role: m.role,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment