Skip to content

Commit

Permalink
Fix Text_to_text blank page
Browse files Browse the repository at this point in the history
  • Loading branch information
amirnd51 committed Feb 23, 2024
1 parent c082226 commit 8e149b6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/ModelDetailPage/ModelDetailPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const ModelDetailPage = (props) => {
const getInputType = () => {
switch (outputType) {
case textToText:
return "text";
case textToCode:
return "text";
case object_detection:
Expand Down
21 changes: 19 additions & 2 deletions src/helpers/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
semantic_segmentation,
textToText,
textToCode,

} from "./TaskIDs";
import React from "react";
import { ReactComponent as ImageClassification } from "../resources/icons/icon-imageClassification.svg";
Expand Down Expand Up @@ -105,7 +106,7 @@ export default class Task {
tutorialDescription:
"Image enhancement models improve the resolution of an image, making it crisper and clearer.",
});
static text = new Task({
static text_to_text = new Task({
name: "Text to Text",
description: "[insert text description here]",
id: textToText,
Expand All @@ -127,6 +128,17 @@ export default class Task {
tutorialDescription: "[insert text to code tutorial page description here]",
inputType: TaskInputTypes.Text,
});
static video_to_text = new Task({
name: "Text to Code",
description: "[insert text to code description here]",
id: video_to_text,
inputText: "[insert text to code input help text here]",
outputText: "[insert text to code output help text here]",
icon: (props) => <></>,
sampleInputs: [],
tutorialDescription: "[insert text to code tutorial page description here]",
inputType: TaskInputTypes.Text,
});

constructor(options) {
this.name = options.name ?? "";
Expand Down Expand Up @@ -160,9 +172,11 @@ export default class Task {
case Task.image_instance_segmentation.name:
return Task.image_instance_segmentation;
case textToText:
return Task.text;
return Task.text_to_text;
case textToCode:
return Task.text_to_code;
case video_to_text:
return Task.video_to_text;

default:
return new Task({ name: "unknown", description: "unknown task name" });
Expand Down Expand Up @@ -203,6 +217,8 @@ export default class Task {
return TestInstanceSegmentationOutput;
case textToText:
return TestTextOutput;
case video_to_text:
return TestTextOutput;
}
}

Expand All @@ -215,6 +231,7 @@ export default class Task {
this.getStaticTask(instance_segmentation),
this.getStaticTask(textToText),
this.getStaticTask(textToCode),
this.getStaticTask(video_to_text),
];
}

Expand Down

0 comments on commit 8e149b6

Please sign in to comment.