Skip to content

Commit

Permalink
fix: comply with PUBLIC_DEFAULT_MODEL env
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Dec 28, 2024
1 parent a860d16 commit efa666a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/Generator.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Index, Match, Show, Switch, batch, createEffect, createSignal, onMount } from 'solid-js'
import { Toaster, toast } from 'solid-toast'
import { useThrottleFn } from 'solidjs-use'
import { PUBLIC_MAX_TOKENS, PUBLIC_MIN_MESSAGES, PUBLIC_MODERATION_INTERVAL } from 'astro:env/client'
import { PUBLIC_DEFAULT_MODEL, PUBLIC_MAX_TOKENS, PUBLIC_MIN_MESSAGES, PUBLIC_MODERATION_INTERVAL } from 'astro:env/client'
import { fetchModeration, fetchTranslation, iterateSuggestion, iterateTitle } from '@/utils/misc'
import { audioChunks, getAudioBlob, startRecording, stopRecording } from '@/utils/record'
import { countTokens, tokenCountCache } from '@/utils/tiktoken'
Expand Down Expand Up @@ -288,8 +288,7 @@ export default () => {
if (localStorage.getItem('apiKey')) headers.authorization = `Bearer ${localStorage.getItem('apiKey')}`

const t = localStorage.getItem('temperature') ?? 'undefined'
const payload: Record<string, any> = { messages: requestMessageList, temperature: t === 'undefined' ? undefined : JSON.parse(t) }
if (localStorage.getItem('model')) payload.model = localStorage.getItem('model')
const payload: Record<string, any> = { messages: requestMessageList, temperature: t === 'undefined' ? undefined : JSON.parse(t), model: localStorage.getItem('model') ?? PUBLIC_DEFAULT_MODEL }

const res = await fetch(`${baseUrl}/single/chat_messages`, {
method: 'PUT',
Expand Down

1 comment on commit efa666a

@vercel
Copy link

@vercel vercel bot commented on efa666a Dec 28, 2024

Choose a reason for hiding this comment

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

Please sign in to comment.