Spaces:
Runtime error
Runtime error
Stronger type to type { ChatCompletionInput } from "@huggingface/tasks";
Browse filesFiles changed (2)
12345678910112 unmodified lines14151691718192017 unmodified lines383940333435363738414243import type { ChatCompletionInput } from "@huggingface/tasks";
export const GENERATION_CONFIG_KEYS = ["temperature", "max_tokens", "top_p"] as const;
export type GenerationConfigKey = (typeof GENERATION_CONFIG_KEYS)[number];
export type GenerationConfig = Pick<ChatCompletionInput, GenerationConfigKey>;
interface GenerationKeySettings { default: number; step: number;2 unmodified lines label: string;}
export const GENERATION_CONFIG_SETTINGS: Record<string, GenerationKeySettings> = {export const GENERATION_CONFIG_SETTINGS: Record<GenerationConfigKey, GenerationKeySettings> = { temperature: { default: 0.5, step: 0.1,17 unmodified lines },};
export type GenerationConfigKey = keyof typeof GENERATION_CONFIG_SETTINGS;
export const GENERATION_CONFIG_KEYS: GenerationConfigKey[] = ["temperature", "max_tokens", "top_p"];
export type GenerationConfig = Record<GenerationConfigKey, number>;
export const defaultGenerationConfig = GENERATION_CONFIG_KEYS.reduce((acc, key) => { acc[key] = GENERATION_CONFIG_SETTINGS[key].default; return acc;22 unmodified lines23242526272627282918 unmodified lines48495052535152535422 unmodified lines { model: model.id, messages, temperature: conversation.config.temperature, max_tokens: conversation.config.max_tokens, ...conversation.config, }, { signal: abortController.signal, use_cache: false } )) {18 unmodified lines { model: model.id, messages, temperature: conversation.config.temperature, max_tokens: conversation.config.max_tokens, ...conversation.config, }, { use_cache: false } );src/lib/components/InferencePlayground/generationConfigSettings.ts+9-7
src/lib/components/InferencePlayground/inferencePlaygroundUtils.ts+2-4