mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
chore: cleanup outdated model & upgrade model (#7739)
This commit is contained in:
@@ -278,18 +278,6 @@ const workflows: Prompt[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const actions: Prompt[] = [
|
const actions: Prompt[] = [
|
||||||
{
|
|
||||||
name: 'debug:action:gpt4',
|
|
||||||
action: 'text',
|
|
||||||
model: 'gpt-4o',
|
|
||||||
messages: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'debug:action:vision4',
|
|
||||||
action: 'text',
|
|
||||||
model: 'gpt-4o',
|
|
||||||
messages: [],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'debug:action:dalle3',
|
name: 'debug:action:dalle3',
|
||||||
action: 'image',
|
action: 'image',
|
||||||
@@ -302,12 +290,6 @@ const actions: Prompt[] = [
|
|||||||
model: 'lcm-sd15-i2i',
|
model: 'lcm-sd15-i2i',
|
||||||
messages: [],
|
messages: [],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'debug:action:fal-sdturbo',
|
|
||||||
action: 'image',
|
|
||||||
model: 'fast-turbo-diffusion',
|
|
||||||
messages: [],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'debug:action:fal-upscaler',
|
name: 'debug:action:fal-upscaler',
|
||||||
action: 'Clearer',
|
action: 'Clearer',
|
||||||
@@ -332,14 +314,14 @@ const actions: Prompt[] = [
|
|||||||
messages: [],
|
messages: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'debug:action:fal-summary-caption',
|
name: 'Generate a caption',
|
||||||
action: 'Generate a caption',
|
action: 'Generate a caption',
|
||||||
model: 'llava-next',
|
model: 'gpt-4o-mini',
|
||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
role: 'user',
|
role: 'user',
|
||||||
content:
|
content:
|
||||||
'Please understand this image and generate a short caption. Limit it to 20 words. {{content}}',
|
'Please understand this image and generate a short caption that can summarize the content of the image. Limit it to up 20 words. {{content}}',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -393,7 +375,7 @@ content: {{content}}`,
|
|||||||
{
|
{
|
||||||
name: 'Explain this image',
|
name: 'Explain this image',
|
||||||
action: 'Explain this image',
|
action: 'Explain this image',
|
||||||
model: 'gpt-4-vision-preview',
|
model: 'gpt-4o',
|
||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
role: 'user',
|
role: 'user',
|
||||||
@@ -692,7 +674,7 @@ content: {{content}}`,
|
|||||||
{
|
{
|
||||||
name: 'Make it real',
|
name: 'Make it real',
|
||||||
action: 'Make it real',
|
action: 'Make it real',
|
||||||
model: 'gpt-4-vision-preview',
|
model: 'gpt-4o',
|
||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
role: 'user',
|
role: 'user',
|
||||||
@@ -731,7 +713,7 @@ content: {{content}}`,
|
|||||||
{
|
{
|
||||||
name: 'Make it real with text',
|
name: 'Make it real with text',
|
||||||
action: 'Make it real with text',
|
action: 'Make it real with text',
|
||||||
model: 'gpt-4-vision-preview',
|
model: 'gpt-4o',
|
||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
role: 'user',
|
role: 'user',
|
||||||
|
|||||||
@@ -43,9 +43,6 @@ export class OpenAIProvider
|
|||||||
// text to text
|
// text to text
|
||||||
'gpt-4o',
|
'gpt-4o',
|
||||||
'gpt-4o-mini',
|
'gpt-4o-mini',
|
||||||
'gpt-4-vision-preview',
|
|
||||||
'gpt-4-turbo-preview',
|
|
||||||
'gpt-3.5-turbo',
|
|
||||||
// embeddings
|
// embeddings
|
||||||
'text-embedding-3-large',
|
'text-embedding-3-large',
|
||||||
'text-embedding-3-small',
|
'text-embedding-3-small',
|
||||||
@@ -203,7 +200,7 @@ export class OpenAIProvider
|
|||||||
// ====== text to text ======
|
// ====== text to text ======
|
||||||
async generateText(
|
async generateText(
|
||||||
messages: PromptMessage[],
|
messages: PromptMessage[],
|
||||||
model: string = 'gpt-3.5-turbo',
|
model: string = 'gpt-4o-mini',
|
||||||
options: CopilotChatOptions = {}
|
options: CopilotChatOptions = {}
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
this.checkParams({ messages, model, options });
|
this.checkParams({ messages, model, options });
|
||||||
@@ -232,7 +229,7 @@ export class OpenAIProvider
|
|||||||
|
|
||||||
async *generateTextStream(
|
async *generateTextStream(
|
||||||
messages: PromptMessage[],
|
messages: PromptMessage[],
|
||||||
model: string = 'gpt-3.5-turbo',
|
model: string = 'gpt-4o-mini',
|
||||||
options: CopilotChatOptions = {}
|
options: CopilotChatOptions = {}
|
||||||
): AsyncIterable<string> {
|
): AsyncIterable<string> {
|
||||||
this.checkParams({ messages, model, options });
|
this.checkParams({ messages, model, options });
|
||||||
|
|||||||
@@ -8,9 +8,7 @@ import type { ChatPrompt } from './prompt';
|
|||||||
export enum AvailableModels {
|
export enum AvailableModels {
|
||||||
// text to text
|
// text to text
|
||||||
Gpt4Omni = 'gpt-4o',
|
Gpt4Omni = 'gpt-4o',
|
||||||
Gpt4VisionPreview = 'gpt-4-vision-preview',
|
Gpt4OmniMini = 'gpt-4o-mini',
|
||||||
Gpt4TurboPreview = 'gpt-4-turbo-preview',
|
|
||||||
Gpt35Turbo = 'gpt-3.5-turbo',
|
|
||||||
// embeddings
|
// embeddings
|
||||||
TextEmbedding3Large = 'text-embedding-3-large',
|
TextEmbedding3Large = 'text-embedding-3-large',
|
||||||
TextEmbedding3Small = 'text-embedding-3-small',
|
TextEmbedding3Small = 'text-embedding-3-small',
|
||||||
@@ -34,7 +32,8 @@ export function getTokenEncoder(model?: string | null): Tokenizer | null {
|
|||||||
// dalle don't need to calc the token
|
// dalle don't need to calc the token
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return fromModelName('gpt-4-turbo-preview');
|
// c100k based model
|
||||||
|
return fromModelName('gpt-4');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,9 +52,7 @@ type CopilotMessageNotFoundDataType {
|
|||||||
enum CopilotModels {
|
enum CopilotModels {
|
||||||
DallE3
|
DallE3
|
||||||
Gpt4Omni
|
Gpt4Omni
|
||||||
Gpt4TurboPreview
|
Gpt4OmniMini
|
||||||
Gpt4VisionPreview
|
|
||||||
Gpt35Turbo
|
|
||||||
TextEmbedding3Large
|
TextEmbedding3Large
|
||||||
TextEmbedding3Small
|
TextEmbedding3Small
|
||||||
TextEmbeddingAda002
|
TextEmbeddingAda002
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export class MockCopilotTestProvider
|
|||||||
|
|
||||||
override async *generateTextStream(
|
override async *generateTextStream(
|
||||||
messages: PromptMessage[],
|
messages: PromptMessage[],
|
||||||
model: string = 'gpt-3.5-turbo',
|
model: string = 'gpt-4o-mini',
|
||||||
options: CopilotChatOptions = {}
|
options: CopilotChatOptions = {}
|
||||||
): AsyncIterable<string> {
|
): AsyncIterable<string> {
|
||||||
this.checkParams({ messages, model, options });
|
this.checkParams({ messages, model, options });
|
||||||
|
|||||||
@@ -2,16 +2,14 @@
|
|||||||
// TODO(@Peng): automate this
|
// TODO(@Peng): automate this
|
||||||
export const promptKeys = [
|
export const promptKeys = [
|
||||||
'debug:chat:gpt4',
|
'debug:chat:gpt4',
|
||||||
'debug:action:gpt4',
|
|
||||||
'debug:action:vision4',
|
|
||||||
'debug:action:dalle3',
|
'debug:action:dalle3',
|
||||||
'debug:action:fal-sd15',
|
'debug:action:fal-sd15',
|
||||||
'debug:action:fal-upscaler',
|
'debug:action:fal-upscaler',
|
||||||
'debug:action:fal-remove-bg',
|
'debug:action:fal-remove-bg',
|
||||||
'debug:action:fal-face-to-sticker',
|
'debug:action:fal-face-to-sticker',
|
||||||
'debug:action:fal-summary-caption',
|
|
||||||
'chat:gpt4',
|
'chat:gpt4',
|
||||||
'Summary',
|
'Summary',
|
||||||
|
'Generate a caption',
|
||||||
'Summary the webpage',
|
'Summary the webpage',
|
||||||
'Explain this',
|
'Explain this',
|
||||||
'Explain this image',
|
'Explain this image',
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ Could you make a new website based on these notes and send back just the html fi
|
|||||||
return textToText({
|
return textToText({
|
||||||
...options,
|
...options,
|
||||||
content: options.input,
|
content: options.input,
|
||||||
promptName: 'debug:action:fal-summary-caption',
|
promptName: 'Generate a caption',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -95,9 +95,7 @@ export interface CopilotMessageNotFoundDataType {
|
|||||||
export enum CopilotModels {
|
export enum CopilotModels {
|
||||||
DallE3 = 'DallE3',
|
DallE3 = 'DallE3',
|
||||||
Gpt4Omni = 'Gpt4Omni',
|
Gpt4Omni = 'Gpt4Omni',
|
||||||
Gpt4TurboPreview = 'Gpt4TurboPreview',
|
Gpt4OmniMini = 'Gpt4OmniMini',
|
||||||
Gpt4VisionPreview = 'Gpt4VisionPreview',
|
|
||||||
Gpt35Turbo = 'Gpt35Turbo',
|
|
||||||
TextEmbedding3Large = 'TextEmbedding3Large',
|
TextEmbedding3Large = 'TextEmbedding3Large',
|
||||||
TextEmbedding3Small = 'TextEmbedding3Small',
|
TextEmbedding3Small = 'TextEmbedding3Small',
|
||||||
TextEmbeddingAda002 = 'TextEmbeddingAda002',
|
TextEmbeddingAda002 = 'TextEmbeddingAda002',
|
||||||
|
|||||||
Reference in New Issue
Block a user