mirror of
https://github.com/open-webui/open-webui
synced 2024-11-24 04:54:12 +00:00
refac: feedback base_models
Some checks failed
Release / release (push) Has been cancelled
Deploy to HuggingFace Spaces / check-secret (push) Has been cancelled
Create and publish Docker images with specific build args / build-main-image (linux/amd64) (push) Has been cancelled
Create and publish Docker images with specific build args / build-main-image (linux/arm64) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda-image (linux/amd64) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda-image (linux/arm64) (push) Has been cancelled
Create and publish Docker images with specific build args / build-ollama-image (linux/amd64) (push) Has been cancelled
Create and publish Docker images with specific build args / build-ollama-image (linux/arm64) (push) Has been cancelled
Python CI / Format Backend (3.11) (push) Has been cancelled
Frontend Build / Format & Build Frontend (push) Has been cancelled
Frontend Build / Frontend Unit Tests (push) Has been cancelled
Integration Test / Run Cypress Integration Tests (push) Has been cancelled
Integration Test / Run Migration Tests (push) Has been cancelled
Release to PyPI / release (push) Has been cancelled
Deploy to HuggingFace Spaces / deploy (push) Has been cancelled
Create and publish Docker images with specific build args / merge-main-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-cuda-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-ollama-images (push) Has been cancelled
Some checks failed
Release / release (push) Has been cancelled
Deploy to HuggingFace Spaces / check-secret (push) Has been cancelled
Create and publish Docker images with specific build args / build-main-image (linux/amd64) (push) Has been cancelled
Create and publish Docker images with specific build args / build-main-image (linux/arm64) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda-image (linux/amd64) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda-image (linux/arm64) (push) Has been cancelled
Create and publish Docker images with specific build args / build-ollama-image (linux/amd64) (push) Has been cancelled
Create and publish Docker images with specific build args / build-ollama-image (linux/arm64) (push) Has been cancelled
Python CI / Format Backend (3.11) (push) Has been cancelled
Frontend Build / Format & Build Frontend (push) Has been cancelled
Frontend Build / Frontend Unit Tests (push) Has been cancelled
Integration Test / Run Cypress Integration Tests (push) Has been cancelled
Integration Test / Run Migration Tests (push) Has been cancelled
Release to PyPI / release (push) Has been cancelled
Deploy to HuggingFace Spaces / deploy (push) Has been cancelled
Create and publish Docker images with specific build args / merge-main-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-cuda-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-ollama-images (push) Has been cancelled
This commit is contained in:
parent
e03e22dd1f
commit
09935d191f
@ -362,8 +362,6 @@
|
|||||||
|
|
||||||
const messages = createMessagesList(history, message.id);
|
const messages = createMessagesList(history, message.id);
|
||||||
|
|
||||||
const baseModelId = $models.find((m) => m.id === message.model)?.info?.base_model_id ?? null;
|
|
||||||
|
|
||||||
let feedbackItem = {
|
let feedbackItem = {
|
||||||
type: 'rating',
|
type: 'rating',
|
||||||
data: {
|
data: {
|
||||||
@ -380,7 +378,6 @@
|
|||||||
meta: {
|
meta: {
|
||||||
arena: message ? message.arena : false,
|
arena: message ? message.arena : false,
|
||||||
model_id: message.model,
|
model_id: message.model,
|
||||||
...(baseModelId ? { base_model_id: baseModelId } : {}),
|
|
||||||
message_id: message.id,
|
message_id: message.id,
|
||||||
message_index: messages.length,
|
message_index: messages.length,
|
||||||
chat_id: chatId
|
chat_id: chatId
|
||||||
@ -390,6 +387,21 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const baseModels = [
|
||||||
|
feedbackItem.data.model_id,
|
||||||
|
...(feedbackItem.data.sibling_model_ids ?? [])
|
||||||
|
].reduce((acc, modelId) => {
|
||||||
|
const model = $models.find((m) => m.id === modelId);
|
||||||
|
if (model) {
|
||||||
|
acc[model.id] = model?.info?.base_model_id ?? null;
|
||||||
|
} else {
|
||||||
|
// Log or handle cases where corresponding model is not found
|
||||||
|
console.warn(`Model with ID ${modelId} not found`);
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
feedbackItem.meta.base_models = baseModels;
|
||||||
|
|
||||||
let feedback = null;
|
let feedback = null;
|
||||||
if (message?.feedbackId) {
|
if (message?.feedbackId) {
|
||||||
feedback = await updateFeedbackById(
|
feedback = await updateFeedbackById(
|
||||||
|
Loading…
Reference in New Issue
Block a user