Spaces:
Paused
Paused
Download types/openai.ts from matthoffner/chatbot: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/spaces/matthoffner/chatbot/resolve/fd7f787b285812b649560130c30cee3feb73f057/types/openai.ts
- Command line
-
hf download hf://spaces/matthoffner/chatbot@fd7f787b285812b649560130c30cee3feb73f057/types/openai.ts
-
curl -L -o openai.ts https://huggingface.co/spaces/matthoffner/chatbot/resolve/fd7f787b285812b649560130c30cee3feb73f057/types/openai.ts
1.26 kB
| import { OPENAI_API_TYPE } from '../utils/app/const'; | |
| export interface OpenAIModel { | |
| id: string; | |
| name: string; | |
| maxLength: number; // maximum length of a message | |
| tokenLimit: number; | |
| } | |
| export enum OpenAIModelID { | |
| Open_LLaMA = 'open-llama-7b', | |
| GPT_3_5 = 'gpt-3.5-turbo', | |
| GPT_3_5_AZ = 'gpt-35-turbo', | |
| GPT_4 = 'gpt-4', | |
| GPT_4_32K = 'gpt-4-32k', | |
| } | |
| // in case the `DEFAULT_MODEL` environment variable is not set or set to an unsupported model | |
| export const fallbackModelID = OpenAIModelID.Open_LLaMA; | |
| export const OpenAIModels: Record<OpenAIModelID, OpenAIModel> = { | |
| [OpenAIModelID.Open_LLaMA]: { | |
| id: OpenAIModelID.Open_LLaMA, | |
| name: 'open-llama-7b', | |
| maxLength: 12000, | |
| tokenLimit: 2048, | |
| }, | |
| [OpenAIModelID.GPT_3_5]: { | |
| id: OpenAIModelID.GPT_3_5, | |
| name: 'open-llama-7b', | |
| maxLength: 12000, | |
| tokenLimit: 4000, | |
| }, | |
| [OpenAIModelID.GPT_3_5_AZ]: { | |
| id: OpenAIModelID.GPT_3_5_AZ, | |
| name: 'open-llama-7b', | |
| maxLength: 12000, | |
| tokenLimit: 4000, | |
| }, | |
| [OpenAIModelID.GPT_4]: { | |
| id: OpenAIModelID.GPT_4, | |
| name: 'GPT-4', | |
| maxLength: 24000, | |
| tokenLimit: 8000, | |
| }, | |
| [OpenAIModelID.GPT_4_32K]: { | |
| id: OpenAIModelID.GPT_4_32K, | |
| name: 'GPT-4-32K', | |
| maxLength: 96000, | |
| tokenLimit: 32000, | |
| }, | |
| }; | |