Skip to content

Commit

Permalink
Make link. Also add GH action that checks for spelling mistakes (#88)
Browse files Browse the repository at this point in the history
- Added `model_name` to the FinishedTaskState, and similarly added an
open button from the import viewer.
- Added new github check for common spelling errors present in the code

![Screenshot 2023-06-30 at 3 10 05
PM](https://github.com/IntrinsicLabsAI/intrinsic-model-server/assets/332583/471bfb71-cb22-4fe5-a252-5a948711c492)
  • Loading branch information
a10y authored Jun 30, 2023
1 parent f55d0aa commit 85ab228
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 18 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Check for common spelling mistakes in docs or Frontend

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
spellcheck:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Scan code for common spelling errors
run: |
if [[ -z "$(grep -n -ri compleat frontend)" ]]; then
exit 0;
else
exit 1;
fi
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ curl 'http://localhost:8000/v1/imports/6ab01cbf-c5c5-4f2f-974a-d163a207bd2c'
"type": "finished",
"info": "Successfully registered ggml-vicuna-7b-1.1__ggml-vic7b-q5_0.bin",
"metadata": {
"model_name": "ggml-vicuna-7b-1.1__ggml-vic7b-q5_0.bin",
"model_id": "646f3b1b-f81e-4d38-a87f-a15a58ed19d6",
"version": "0.1.0"
}
Expand Down Expand Up @@ -220,4 +221,4 @@ npm run lint

# run the live dev server
npm run dev
```
```
2 changes: 1 addition & 1 deletion frontend/src/components/InferenceExploration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export default function InferenceExploration({
<>
<OneColumnLayout>
<Callout>
<h3 className=" text-lg font-semibold text-dark-500 leading-none ">Compleation Experiments</h3>
<h3 className=" text-lg font-semibold text-dark-500 leading-none ">Completion Experiments</h3>
<p className=" text-dark-500 leading-tight mt-2 ">
This space allows you to run experiments with models that are deployed to the server.
Use this space to explore what is possible and refine your understanding of the boundaries of your model.
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/core/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export default function Timeline(
</div>
{event.metadata && (
<div className=" grid grid-cols-2 gap-2 w-full">
{event.metadata.map((item) => (
<div className="flex flex-row gap-1 items-center">
{event.metadata.map((item, idx) => (
<div key={idx} className="flex flex-row gap-1 items-center">
{item.icon && (<Icon icon={item.icon} size={12} color="#DCE0E5" />)}
<p className=" leading-none font-mono text-xs text-gray-200">{item.value}</p>
</div>
Expand Down
33 changes: 24 additions & 9 deletions frontend/src/pages/ImportModel.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { useGetImportStatusQuery } from "../api/services/v1";
import { useParams } from "react-router-dom";
import { Link, useParams } from "react-router-dom";
import Page from "../components/layout/Page";
import OneColumnLayout from "../components/layout/OneColumnLayout";
import Column from "../components/layout/Column";
import Callout from "../components/core/Callout";
import Button from "../components/core/Button";
import Card from "../components/core/Card";
import { useNavigate } from "react-router-dom";
import { Icon } from "@blueprintjs/core";

function ProgressBar({
status,
Expand Down Expand Up @@ -49,11 +50,11 @@ export default function ImportModel() {
<h1 className=" font-semibold text-2xl leading-none pb-1">Importing Model from HuggingFace</h1>
<h3 className=" text-gray-400/60 pb-3">Import Job: {importJob}</h3>
</div>
<Button
<Button
onAction={() => navigate("/")}
buttonText="View Model"
type="text"
disabled={data?.type === "finished" ? false : true } />
buttonText="View Model"
type="text"
disabled={data?.type === "finished" ? false : true} />
</div>
<>
{data?.type === "in-progress" && (
Expand Down Expand Up @@ -109,19 +110,33 @@ export default function ImportModel() {
<p className=" font-mono pt-2 text-sm font-semibold text-center ">Error: {data?.error}</p>
</>
)}
{data?.type === "finished" && (
{data && data.type === "finished" && (
<>
<p className="font-semibold animate-none mt-2">The model import has compleated</p>
<p className="font-semibold animate-none mt-2">The model import has completed</p>
<p className="animate-none pt-2 leading-tight">
Your model is now available to use and available via API to all users of the server.
</p>
<p className=" font-mono pt-2 text-sm font-semibold text-center ">{data?.info}</p>

<p className=" font-mono pt-2 text-sm font-semibold text-center flex flex-row ">
{data?.info}
{
Object.prototype.hasOwnProperty.call(data.metadata, "model_name")
&& (
<span className="ml-2">

<Link to={`/model/${data.metadata!["model_name"]}`}> {/* eslint-disable-line @typescript-eslint/no-non-null-assertion */}
<Icon icon="document-open" size={18} color={"#53b79a"} />
</Link>
</span>
)
}
</p>
</>
)}
</div>
</Card>
</Column>
</OneColumnLayout>
</Page>
</Page >
)
}
11 changes: 6 additions & 5 deletions modelserver/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ def handle_download_disk_model(
TaskState.parse_obj(
FinishedTaskState(
info=model_name,
metadata={
model_id: model_id,
version: version,
},
metadata=dict(
model_name=model_name, model_id=model_id, version=version
),
).dict()
),
)
Expand Down Expand Up @@ -135,7 +134,9 @@ def handle_download_hf_model(
TaskState.parse_obj(
FinishedTaskState(
info=f"Successfully registered {modelname}",
metadata=dict(model_id=model_id, version=version),
metadata=dict(
model_name=modelname, model_id=model_id, version=version
),
).dict()
),
)
Expand Down

0 comments on commit 85ab228

Please sign in to comment.