Skip to content

Commit

Permalink
logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mruwnik committed Apr 7, 2024
1 parent 491b188 commit 7c56f49
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-to-production.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Deploy to Production Server
on:
workflow_dispatch:
push:
branches: [main]

Expand Down
28 changes: 20 additions & 8 deletions web/src/hooks/useSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ export const MODELS: { [key: string]: Model } = {
"gpt-3.5-turbo-16k": { maxNumTokens: 16385, topKBlocks: 30 },
"gpt-4": { maxNumTokens: 8192, topKBlocks: 20 },
"gpt-4-turbo-preview": { maxNumTokens: 128000, topKBlocks: 50 },
"claude-3-opus-20240229": { maxNumTokens: 200000, topKBlocks: 50},
"claude-3-sonnet-20240229": { maxNumTokens: 200_000, topKBlocks: 50},
"claude-3-haiku-20240307": { maxNumTokens: 200_000, topKBlocks: 50},
"claude-2.1": { maxNumTokens: 200_000, topKBlocks: 50},
"claude-2.0": { maxNumTokens: 100_000, topKBlocks: 50},
"claude-instant-1.2": { maxNumTokens: 100_000, topKBlocks: 50},
"claude-3-opus-20240229": { maxNumTokens: 200000, topKBlocks: 50 },
"claude-3-sonnet-20240229": { maxNumTokens: 200_000, topKBlocks: 50 },
"claude-3-haiku-20240307": { maxNumTokens: 200_000, topKBlocks: 50 },
"claude-2.1": { maxNumTokens: 200_000, topKBlocks: 50 },
"claude-2.0": { maxNumTokens: 100_000, topKBlocks: 50 },
"claude-instant-1.2": { maxNumTokens: 100_000, topKBlocks: 50 },
};
export const ENCODERS = ["cl100k_base"];

Expand Down Expand Up @@ -189,11 +189,23 @@ export default function useSettings() {
const [settings, updateSettings] = useState<LLMSettings>(makeSettings({}));
const router = useRouter();

const updateInUrl = (vals: { [key: string]: any }) =>
router.replace({
const updateInUrl = (vals: { [key: string]: any }) => {
console.log(
"updating settings",
router.isReady,
router.pathname,
router.query,
vals,
{
pathname: router.pathname,
query: { ...router.query, ...vals },
}
);
return router.replace({
pathname: router.pathname,
query: { ...router.query, ...vals },
});
};

const changeSetting = (path: string[], value: any) => {
updateInUrl({ [path.join(".")]: value });
Expand Down

0 comments on commit 7c56f49

Please sign in to comment.