Caleb Fahlgren
commited on
Commit
·
132e085
1
Parent(s):
32e1a9b
add toasts
Browse files- app/layout.tsx +2 -0
- app/page.tsx +5 -2
- lib/queries.ts +1 -1
- package-lock.json +10 -0
- package.json +1 -0
app/layout.tsx
CHANGED
@@ -7,6 +7,7 @@ import { cn } from "@/lib/utils"
|
|
7 |
import { SiteHeader } from "@/components/site-header"
|
8 |
import { TailwindIndicator } from "@/components/tailwind-indicator"
|
9 |
import { ThemeProvider } from "@/components/theme-provider"
|
|
|
10 |
|
11 |
export const metadata: Metadata = {
|
12 |
title: {
|
@@ -48,6 +49,7 @@ export default function RootLayout({ children }: RootLayoutProps) {
|
|
48 |
<TailwindIndicator />
|
49 |
</ThemeProvider>
|
50 |
</body>
|
|
|
51 |
</html>
|
52 |
</>
|
53 |
)
|
|
|
7 |
import { SiteHeader } from "@/components/site-header"
|
8 |
import { TailwindIndicator } from "@/components/tailwind-indicator"
|
9 |
import { ThemeProvider } from "@/components/theme-provider"
|
10 |
+
import { Toaster } from 'sonner'
|
11 |
|
12 |
export const metadata: Metadata = {
|
13 |
title: {
|
|
|
49 |
<TailwindIndicator />
|
50 |
</ThemeProvider>
|
51 |
</body>
|
52 |
+
<Toaster />
|
53 |
</html>
|
54 |
</>
|
55 |
)
|
app/page.tsx
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
import { useEffect, useState } from "react"
|
4 |
import * as duckdb from "@duckdb/duckdb-wasm"
|
5 |
import { Loader2 } from "lucide-react"
|
|
|
6 |
|
7 |
import { CREATE_VIEWS_QUERY, FETCH_CHART_DATA_QUERY, FETCH_DATASET_LICENSE_DATA_QUERY, FETCH_FINETUNE_MODEL_GROWTH_QUERY, FETCH_MODEL_LICENSE_DATA_QUERY, FETCH_SPACE_SDK_DATA_QUERY } from "@/lib/queries"
|
8 |
import { AreaChartStacked, ChartDataPoint } from "@/components/area-chart-stacked"
|
@@ -107,6 +108,7 @@ export default function IndexPage() {
|
|
107 |
e.preventDefault()
|
108 |
if (!conn) {
|
109 |
console.warn("Database connection not established")
|
|
|
110 |
return
|
111 |
}
|
112 |
|
@@ -123,6 +125,7 @@ export default function IndexPage() {
|
|
123 |
setFinetuneModelGrowthData(data)
|
124 |
} catch (error) {
|
125 |
console.error("Error executing query:", error)
|
|
|
126 |
} finally {
|
127 |
setIsLoading(false)
|
128 |
}
|
@@ -169,7 +172,7 @@ export default function IndexPage() {
|
|
169 |
<input
|
170 |
type="text"
|
171 |
value={baseModel}
|
172 |
-
onChange={(e) => setBaseModel(e.target.value)}
|
173 |
placeholder="Base Model Name"
|
174 |
className="px-4 w-full py-2 border rounded"
|
175 |
/>
|
@@ -190,7 +193,7 @@ export default function IndexPage() {
|
|
190 |
<div className="flex flex-col gap-4 max-w-4xl mt-10 w-full mx-auto">
|
191 |
<SimpleArea
|
192 |
title="Finetune Model Growth"
|
193 |
-
description={`Showing the growth of finetune models over time for ${baseModel || "your favorite model
|
194 |
data={finetuneModelGrowthData}
|
195 |
/>
|
196 |
</div>
|
|
|
3 |
import { useEffect, useState } from "react"
|
4 |
import * as duckdb from "@duckdb/duckdb-wasm"
|
5 |
import { Loader2 } from "lucide-react"
|
6 |
+
import { toast } from 'sonner'
|
7 |
|
8 |
import { CREATE_VIEWS_QUERY, FETCH_CHART_DATA_QUERY, FETCH_DATASET_LICENSE_DATA_QUERY, FETCH_FINETUNE_MODEL_GROWTH_QUERY, FETCH_MODEL_LICENSE_DATA_QUERY, FETCH_SPACE_SDK_DATA_QUERY } from "@/lib/queries"
|
9 |
import { AreaChartStacked, ChartDataPoint } from "@/components/area-chart-stacked"
|
|
|
108 |
e.preventDefault()
|
109 |
if (!conn) {
|
110 |
console.warn("Database connection not established")
|
111 |
+
toast.error("Database connection not established")
|
112 |
return
|
113 |
}
|
114 |
|
|
|
125 |
setFinetuneModelGrowthData(data)
|
126 |
} catch (error) {
|
127 |
console.error("Error executing query:", error)
|
128 |
+
toast.error(`Failed to fetch data for ${baseModel}`)
|
129 |
} finally {
|
130 |
setIsLoading(false)
|
131 |
}
|
|
|
172 |
<input
|
173 |
type="text"
|
174 |
value={baseModel}
|
175 |
+
onChange={(e) => setBaseModel(e.target.value.trim())}
|
176 |
placeholder="Base Model Name"
|
177 |
className="px-4 w-full py-2 border rounded"
|
178 |
/>
|
|
|
193 |
<div className="flex flex-col gap-4 max-w-4xl mt-10 w-full mx-auto">
|
194 |
<SimpleArea
|
195 |
title="Finetune Model Growth"
|
196 |
+
description={`Showing the growth of finetune models over time for ${baseModel || "your favorite model"}`}
|
197 |
data={finetuneModelGrowthData}
|
198 |
/>
|
199 |
</div>
|
lib/queries.ts
CHANGED
@@ -44,7 +44,7 @@ export const FETCH_SPACE_SDK_DATA_QUERY = `
|
|
44 |
|
45 |
export const FETCH_FINETUNE_MODEL_GROWTH_QUERY = (baseModel: string) => `
|
46 |
WITH RECURSIVE month_series AS (
|
47 |
-
SELECT DATE_TRUNC('month', MIN(CAST(createdAt AS TIMESTAMP))) AS month
|
48 |
FROM models, UNNEST(tags) AS t(tag)
|
49 |
WHERE tag = 'base_model:${baseModel}'
|
50 |
|
|
|
44 |
|
45 |
export const FETCH_FINETUNE_MODEL_GROWTH_QUERY = (baseModel: string) => `
|
46 |
WITH RECURSIVE month_series AS (
|
47 |
+
SELECT DATE_TRUNC('month', MIN(CAST(createdAt AS TIMESTAMP))) - INTERVAL 1 MONTH AS month
|
48 |
FROM models, UNNEST(tags) AS t(tag)
|
49 |
WHERE tag = 'base_model:${baseModel}'
|
50 |
|
package-lock.json
CHANGED
@@ -19,6 +19,7 @@
|
|
19 |
"react-dom": "^18.2.0",
|
20 |
"recharts": "^2.12.7",
|
21 |
"sharp": "^0.31.3",
|
|
|
22 |
"tailwind-merge": "^1.13.2",
|
23 |
"tailwindcss-animate": "^1.0.6"
|
24 |
},
|
@@ -5554,6 +5555,15 @@
|
|
5554 |
"node": ">=8"
|
5555 |
}
|
5556 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5557 |
"node_modules/source-map-js": {
|
5558 |
"version": "1.2.0",
|
5559 |
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
|
|
|
19 |
"react-dom": "^18.2.0",
|
20 |
"recharts": "^2.12.7",
|
21 |
"sharp": "^0.31.3",
|
22 |
+
"sonner": "^1.5.0",
|
23 |
"tailwind-merge": "^1.13.2",
|
24 |
"tailwindcss-animate": "^1.0.6"
|
25 |
},
|
|
|
5555 |
"node": ">=8"
|
5556 |
}
|
5557 |
},
|
5558 |
+
"node_modules/sonner": {
|
5559 |
+
"version": "1.5.0",
|
5560 |
+
"resolved": "https://registry.npmjs.org/sonner/-/sonner-1.5.0.tgz",
|
5561 |
+
"integrity": "sha512-FBjhG/gnnbN6FY0jaNnqZOMmB73R+5IiyYAw8yBj7L54ER7HB3fOSE5OFiQiE2iXWxeXKvg6fIP4LtVppHEdJA==",
|
5562 |
+
"peerDependencies": {
|
5563 |
+
"react": "^18.0.0",
|
5564 |
+
"react-dom": "^18.0.0"
|
5565 |
+
}
|
5566 |
+
},
|
5567 |
"node_modules/source-map-js": {
|
5568 |
"version": "1.2.0",
|
5569 |
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
|
package.json
CHANGED
@@ -25,6 +25,7 @@
|
|
25 |
"react-dom": "^18.2.0",
|
26 |
"recharts": "^2.12.7",
|
27 |
"sharp": "^0.31.3",
|
|
|
28 |
"tailwind-merge": "^1.13.2",
|
29 |
"tailwindcss-animate": "^1.0.6"
|
30 |
},
|
|
|
25 |
"react-dom": "^18.2.0",
|
26 |
"recharts": "^2.12.7",
|
27 |
"sharp": "^0.31.3",
|
28 |
+
"sonner": "^1.5.0",
|
29 |
"tailwind-merge": "^1.13.2",
|
30 |
"tailwindcss-animate": "^1.0.6"
|
31 |
},
|