Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Simplify setup, prepare for multi-models #156

Merged
merged 10 commits into from
May 3, 2023
Merged

Conversation

coyotte508
Copy link
Member

@coyotte508 coyotte508 commented May 2, 2023

In preparation to open-sourcing the repo, simply the config needed:

  • a mongo url
  • an HF access token

Incidentally, this refacto helps prepare for multi-model

Note: this loses the distinction between MODEL_NAME and MODEL_ID for the sake of configuration simplicity (and I think that's for the better, but can be reverted)

(don't forget to update your .env.local to test with prod model if you want - otherwise just setting HF_ACCESS_TOKEN in .env.local is enough)

With default configuration:

image


image

@coyotte508 coyotte508 marked this pull request as ready for review May 2, 2023 21:20
.env Show resolved Hide resolved
@coyotte508 coyotte508 requested a review from julien-c May 3, 2023 10:44
@coyotte508 coyotte508 requested review from Grsmto and gary149 May 3, 2023 12:46
.env Show resolved Hide resolved
@coyotte508 coyotte508 merged commit 7764421 into main May 3, 2023
@coyotte508 coyotte508 deleted the simpler-base-config branch May 3, 2023 19:04
Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like i was too slow:)

@@ -6,6 +6,7 @@ import {
PUBLIC_DEPRECATED_GOOGLE_ANALYTICS_ID,
} from "$env/static/public";
import { addYears } from "date-fns";
import { inspect } from "node:util";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { inspect } from "node:util";

@@ -2,4 +2,6 @@ export interface Message {
from: "user" | "assistant";
id: ReturnType<typeof crypto.randomUUID>;
content: string;
// Only for "assistant" messages
model?: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this should instead be on Conversation (and always be defined, i.e. we can migrate current DB)

Otherwise how do you export the conv data to a model author?

Suggested change
model?: string;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gary149 wanted to be able to switch models during a conversation

Otherwise how do you export the conv data to a model author?

Since we send the whole exchange everytime to the model during the inference, it makes sense to send to the model author the whole conversation up to the last response by their own model

@@ -30,10 +31,14 @@ export async function POST({ request, fetch, locals, params }) {
const json = await request.json();
const {
inputs: newPrompt,
model,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or pass a conv id instead of a model here, and get the model from the DB

ice91 pushed a commit to ice91/chat-ui that referenced this pull request Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants