Skip to content

Commit

Permalink
[editor] HuggingFaceImage2TextTransformerPromptSchema
Browse files Browse the repository at this point in the history
# [editor] HuggingFaceImage2TextTransformerPromptSchema

Get the input schema implemented so the input renders. Need to add model_settings afterwards

![Screenshot 2024-01-09 at 10 57 28 PM](https://github.com/lastmile-ai/aiconfig/assets/5060851/8388b478-f9f3-4654-a8e3-57a81bef7c5e)
  • Loading branch information
Ryan Holinshead committed Jan 10, 2024
1 parent 489aa28 commit 7d38044
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { PromptSchema } from "../../utils/promptUtils";

export const HuggingFaceImage2TextTransformerPromptSchema: PromptSchema = {
input: {
type: "object",
required: ["data"],
properties: {
attachments: {
type: "array",
items: {
type: "attachment",
required: ["data"],
mime_types: ["image/png"],
properties: {
data: {
type: "string",
},
},
},
max_items: 1,
},
},
},
};
4 changes: 3 additions & 1 deletion python/src/aiconfig/editor/client/src/utils/promptUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { HuggingFaceText2ImageDiffusorPromptSchema } from "../shared/prompt_sche
import { HuggingFaceTextGenerationTransformerPromptSchema } from "../shared/prompt_schemas/HuggingFaceTextGenerationTransformerPromptSchema";
import { HuggingFaceAutomaticSpeechRecognitionPromptSchema } from "../shared/prompt_schemas/HuggingFaceAutomaticSpeechRecognitionPromptSchema";
import { HuggingFaceTextSummarizationTransformerPromptSchema } from "../shared/prompt_schemas/HuggingFaceTextSummarizationTransformerPromptSchema";
import { HuggingFaceImage2TextTransformerPromptSchema } from "../shared/prompt_schemas/HuggingFaceImage2TextTransformerPromptSchema";

/**
* Get the name of the model for the specified prompt. The name will either be specified in the prompt's
Expand Down Expand Up @@ -94,7 +95,8 @@ export const PROMPT_SCHEMAS: Record<string, PromptSchema> = {
HuggingFaceTextSummarizationTransformerPromptSchema,
HuggingFaceTextTranslationTransformer:
HuggingFaceTextGenerationTransformerPromptSchema,
// Image2Text: HuggingFaceImage2TextTransformerPromptSchema,
HuggingFaceImage2TextTransformer:
HuggingFaceImage2TextTransformerPromptSchema,
// Text2Speech: HuggingFaceText2SpeechTransformerPromptSchema,
};

Expand Down

0 comments on commit 7d38044

Please sign in to comment.