Skip to content

Commit

Permalink
fe boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
Feroze Mohideen committed May 16, 2024
1 parent e92f3aa commit 8be673b
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 132 deletions.
2 changes: 1 addition & 1 deletion dashboard/src/lib/addons/deepgram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const deepgramConfigValidator = z.object({
deepgramAPIKey: z.string().nonempty().default("*********"),
quayUsername: z.string().nonempty().default("username"),
quaySecret: z.string().nonempty().default("secret"),
quayEmail: z.string(),
quayEmail: z.string().nonempty().default(""),
releaseTag: z.string().nonempty().default("release-240426"),
});

Expand Down
8 changes: 7 additions & 1 deletion dashboard/src/lib/addons/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Logs from "main/home/add-on-dashboard/common/Logs";
import Settings from "main/home/add-on-dashboard/common/Settings";
import DatadogForm from "main/home/add-on-dashboard/datadog/DatadogForm";
import DeepgramForm from "main/home/add-on-dashboard/deepgram/DeepgramForm";
import DeepgramOverview from "main/home/add-on-dashboard/deepgram/DeepgramOverview";
import MetabaseForm from "main/home/add-on-dashboard/metabase/MetabaseForm";
import MezmoForm from "main/home/add-on-dashboard/mezmo/MezmoForm";
import NewRelicForm from "main/home/add-on-dashboard/newrelic/NewRelicForm";
Expand Down Expand Up @@ -291,6 +292,11 @@ export const ADDON_TEMPLATE_DEEPGRAM: AddonTemplate<"deepgram"> = {
icon: "https://play-lh.googleusercontent.com/wczDL05-AOb39FcL58L32h6j_TrzzGTXDLlOrOmJ-aNsnoGsT1Gkk2vU4qyTb7tGxRw=w240-h480-rw",
tags: ["Networking"],
tabs: [
{
name: "overview",
displayName: "Overview",
component: DeepgramOverview,
},
{
name: "configuration",
displayName: "Configuration",
Expand All @@ -314,7 +320,7 @@ export const ADDON_TEMPLATE_DEEPGRAM: AddonTemplate<"deepgram"> = {
quayUsername: "",
quaySecret: "",
quayEmail: "",
releaseTag: "v1.0.0",
releaseTag: "",
},
isModelTemplate: true,
};
Expand Down
20 changes: 2 additions & 18 deletions dashboard/src/main/home/add-on-dashboard/deepgram/DeepgramForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,6 @@ const DeepgramForm: React.FC = () => {
} = useFormContext<ClientAddon>();
return (
<div>
<Text size={16}> Instance type </Text>
<Spacer y={0.5} />
<Text color="helper">
The instance type to run the model on. Deepgram runs only on T4 GPUs and
we have prefilled a preferred instance type for now. Make sure the AWS
quota is properly set.{" "}
</Text>
<Spacer y={0.5} />
<ControlledInput
type="text"
width="300px"
{...register("config.instanceType")}
placeholder="g4dn-xlarge"
error={errors.config?.instanceType?.message}
/>
<Spacer y={1} />
<Text size={16}> Release tag </Text>
<Spacer y={0.5} />
<Text color="helper">
Expand All @@ -51,9 +35,9 @@ const DeepgramForm: React.FC = () => {
<ControlledInput
type="password"
width="300px"
{...register("config.deepgramApiKey")}
{...register("config.deepgramAPIKey")}
placeholder="deepgram-api-key"
error={errors.config?.deepgramApiKey?.message}
error={errors.config?.deepgramAPIKey?.message}
/>
<Spacer y={1} />
<Text size={16}> Quay.io Username </Text>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from "react";
import AceEditor from "react-ace";

import Spacer from "components/porter/Spacer";
import Text from "components/porter/Text";

const DeepgramOverview: React.FC = () => {
return (
<div>
<Text size={16}>Example usage</Text>
<Spacer y={0.5} />
<Text color="helper">
You can use this model over an auto-generated endpoint from any app
running on Porter.
</Text>
<Spacer y={1} />
<AceEditor
value={`curl http://my-model.default.svc.cluster.local:8000/v1/completions
-H "Content-Type: application/json"
-d '{
"prompt": "Long Island City is a",
"max_tokens": 7,
"temperature": 0
}'`}
theme="porter"
name="codeEditor"
readOnly={true}
height="120px"
width="100%"
style={{ borderRadius: "10px", color: "#aaaabb" }}
showPrintMargin={false}
showGutter={true}
highlightActiveLine={false}
/>
</div>
);
};

export default DeepgramOverview;
112 changes: 0 additions & 112 deletions dashboard/src/main/home/inference-dashboard/ExpandedModelTemplate.tsx

This file was deleted.

0 comments on commit 8be673b

Please sign in to comment.