3v324v23 commited on
Commit
31d949e
·
1 Parent(s): 71e2514
package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
  {
2
- "name": "nextjs-docker-starter",
3
- "version": "1.0.0",
4
  "lockfileVersion": 3,
5
  "requires": true,
6
  "packages": {
7
  "": {
8
- "name": "nextjs-docker-starter",
9
- "version": "1.0.0",
10
  "license": "MIT",
11
  "dependencies": {
12
  "@emotion/cache": "11.10.7",
 
1
  {
2
+ "name": "nextjs-hf-spaces",
3
+ "version": "0.0.1",
4
  "lockfileVersion": 3,
5
  "requires": true,
6
  "packages": {
7
  "": {
8
+ "name": "nextjs-hf-spaces",
9
+ "version": "0.0.1",
10
  "license": "MIT",
11
  "dependencies": {
12
  "@emotion/cache": "11.10.7",
src/components/example-components.tsx DELETED
@@ -1,35 +0,0 @@
1
- import { Box, Stack, Typography } from "@mui/material";
2
- import Huggingface from "./huggingface/huggingface";
3
- import { DividerBox, HighlightBox, SectionBox } from "./base/boxes";
4
- import { UnderConstruction } from "./under-construction";
5
-
6
- export default function ExampleComponents() {
7
- return (
8
- <>
9
- <SectionBox>
10
- <Stack spacing={2}>
11
- <Typography component="h2" variant="h3">
12
- Components
13
- </Typography>
14
-
15
- <Typography variant="body1">
16
- Unsure where to begin? Our pre-built components offer a jumpstart
17
- for your ML demo 🚀
18
- </Typography>
19
- </Stack>
20
- </SectionBox>
21
-
22
- <Huggingface />
23
-
24
- <DividerBox />
25
-
26
- <Stack spacing={4}>
27
- <HighlightBox>
28
- <Typography variant="h4">More comming soon!</Typography>
29
- </HighlightBox>
30
-
31
- <UnderConstruction />
32
- </Stack>
33
- </>
34
- );
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/components/footer.tsx DELETED
@@ -1,32 +0,0 @@
1
- import Box from "@mui/material/Box";
2
- import Image from "next/image";
3
- import { Divider, Link } from "@mui/material";
4
-
5
- const Footer = () => {
6
- return (
7
- <Box
8
- component="footer"
9
- sx={{
10
- display: "flex",
11
- justifyContent: "center",
12
- gap: 1,
13
- alignItems: "center",
14
- mt: 8,
15
- mb: 4,
16
- }}
17
- >
18
- <Link
19
- href="https://failfa.st"
20
- display="flex"
21
- alignItems="center"
22
- rel="noopener"
23
- target="_blank"
24
- >
25
- <Box sx={{ mr: 0.5 }}>Powered by</Box>{" "}
26
- <Image src="/failfast.svg" alt="failfast Logo" width="32" height="32" />
27
- </Link>
28
- </Box>
29
- );
30
- };
31
-
32
- export default Footer;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/components/getting-started.tsx DELETED
@@ -1,150 +0,0 @@
1
- import {
2
- Button,
3
- Grid,
4
- Link,
5
- List,
6
- ListItem,
7
- ListItemIcon,
8
- ListItemText,
9
- ListSubheader,
10
- Paper,
11
- Stack,
12
- Typography,
13
- } from "@mui/material";
14
-
15
- import ViewQuiltIcon from "@mui/icons-material/ViewQuilt";
16
- import SailingIcon from "@mui/icons-material/Sailing";
17
- import LightModeIcon from "@mui/icons-material/LightMode";
18
- import SentimentVerySatisfiedIcon from "@mui/icons-material/SentimentVerySatisfied";
19
- import ContentCopyIcon from "@mui/icons-material/ContentCopy";
20
- import LinkIcon from "@mui/icons-material/Link";
21
- import SyncIcon from "@mui/icons-material/Sync";
22
- import { HighlightBox } from "./base/boxes";
23
-
24
- export default function GettingStarted() {
25
- return (
26
- <>
27
- <Grid container spacing={2} sx={{ justifyContent: "center" }}>
28
- <Grid item sm={8} lg={6}>
29
- <Paper sx={{ p: 2 }}>
30
- <List disablePadding>
31
- <ListSubheader sx={{ fontSize: "1.5em" }}>Features</ListSubheader>
32
-
33
- <ListItem>
34
- <ListItemIcon>
35
- <SentimentVerySatisfiedIcon />
36
- </ListItemIcon>
37
- <ListItemText>
38
- <Link
39
- href="https://huggingface.co/docs/huggingface.js/index"
40
- target="_blank"
41
- rel="noopener"
42
- >
43
- huggingface.js
44
- </Link>{" "}
45
- components (WIP)
46
- </ListItemText>
47
- </ListItem>
48
-
49
- <ListItem>
50
- <ListItemIcon>
51
- <LinkIcon />
52
- </ListItemIcon>
53
- <ListItemText>
54
- <Link
55
- href="https://js.langchain.com/docs"
56
- target="_blank"
57
- rel="noopener"
58
- >
59
- langchain.js
60
- </Link>{" "}
61
- and{" "}
62
- <Link
63
- href="https://github.com/failfa-st/hyv"
64
- target="_blank"
65
- rel="noopener"
66
- >
67
- hyv
68
- </Link>{" "}
69
- components (comming soon)
70
- </ListItemText>
71
- </ListItem>
72
-
73
- <ListItem>
74
- <ListItemIcon>
75
- <ViewQuiltIcon />
76
- </ListItemIcon>
77
- <ListItemText>
78
- Rapid prototyping with{" "}
79
- <Link
80
- href="https://mui.com/material-ui/getting-started/overview/"
81
- target="_blank"
82
- rel="noopener"
83
- >
84
- MUI
85
- </Link>
86
- </ListItemText>
87
- </ListItem>
88
- <ListItem>
89
- <ListItemIcon>
90
- <LightModeIcon />
91
- </ListItemIcon>
92
- <ListItemText>
93
- Dark / light theme based on system preferences
94
- </ListItemText>
95
- </ListItem>
96
- <ListItem>
97
- <ListItemIcon>
98
- <SyncIcon />
99
- </ListItemIcon>
100
- <ListItemText>
101
- Sync your GitHub repository with your 🤗 Space
102
- </ListItemText>
103
- </ListItem>
104
- <ListItem>
105
- <ListItemIcon>
106
- <SailingIcon />
107
- </ListItemIcon>
108
- <ListItemText>Runs in Docker or localhost</ListItemText>
109
- </ListItem>
110
- </List>
111
- </Paper>
112
- </Grid>
113
-
114
- <Grid item sm={4} lg={3}>
115
- <Stack gap={2}>
116
- <Paper sx={{ p: 2 }}>
117
- <Typography variant="body1">
118
- Explore the{" "}
119
- <Link
120
- href="https://huggingface.co/spaces/failfast/nextjs-docker-starter/blob/main/README.md"
121
- target="_blank"
122
- rel="noopener"
123
- >
124
- README
125
- </Link>{" "}
126
- for a comprehensive guide on local development, Docker
127
- utilization, secret management, and GitHub-based Space control.
128
- </Typography>
129
- </Paper>
130
-
131
- <Paper sx={{ p: 2 }}>
132
- <Typography variant="body1">
133
- Have feedback or ideas?{" "}
134
- <Link
135
- href="https://huggingface.co/spaces/failfast/nextjs-docker-starter/discussions"
136
- target="_blank"
137
- rel="noopener"
138
- >
139
- We&apos;re eager to hear from you!
140
- </Link>{" "}
141
- As an open-source project in its early stages, your input can
142
- significantly shape our development.
143
- </Typography>
144
- </Paper>
145
- </Stack>
146
- </Grid>
147
- </Grid>
148
- </>
149
- );
150
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/components/huggingface/huggingface.tsx DELETED
@@ -1,64 +0,0 @@
1
- import { Alert, Link, Typography } from "@mui/material";
2
- import { HfInference } from "@huggingface/inference";
3
- import { useEffect } from "react";
4
- import Summarization from "./inference/summarization";
5
- import { HighlightBox } from "../base/boxes";
6
- import Code from "../base/code";
7
-
8
- export type InferenceProps = {
9
- token?: string;
10
- model: string;
11
- };
12
-
13
- export default function Huggingface() {
14
- return (
15
- <>
16
- <HighlightBox>
17
- <Typography component="h4" variant="h4">
18
- huggingface.js
19
- </Typography>
20
- </HighlightBox>
21
-
22
- <Typography variant="body1">
23
- <Link
24
- href="https://huggingface.co/docs/huggingface.js/index"
25
- target="_blank"
26
- rel="noopener"
27
- >
28
- huggingface.js
29
- </Link>{" "}
30
- is a suite of JavaScript libraries that interact with the Hugging Face
31
- API. It enables the use of over 100,000 ML models or your own via the{" "}
32
- <Link
33
- href="https://huggingface.co/docs/inference-endpoints/index"
34
- target="_blank"
35
- rel="noopener"
36
- >
37
- Inference API
38
- </Link>
39
- , and supports managing Hugging Face repositories.
40
- </Typography>
41
-
42
- <Alert severity="info">
43
- When you run into rate limits while using the components, make sure to
44
- add your 🤗 access token (optained via your{" "}
45
- <Link
46
- href="https://huggingface.co/settings/tokens"
47
- target="_blank"
48
- rel="noopener"
49
- >
50
- account settings
51
- </Link>
52
- ) into `HF Access Token` under &quot;Options&quot;.
53
- </Alert>
54
-
55
- <Typography component="h5" variant="h5">
56
- Summarization
57
- </Typography>
58
-
59
- <Code>{`<Summarization model="facebook/bart-large-cnn" maxLength={100} />`}</Code>
60
-
61
- <Summarization model="facebook/bart-large-cnn" maxLength={100} />
62
- </>
63
- );
64
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/components/title.tsx DELETED
@@ -1,62 +0,0 @@
1
- import { Button, Link, Paper, Stack, Typography } from "@mui/material";
2
- import { HighlightBox } from "./base/boxes";
3
- import ContentCopyIcon from "@mui/icons-material/ContentCopy";
4
-
5
- export default function Title() {
6
- return (
7
- <Stack
8
- spacing={4}
9
- sx={{
10
- justifyContent: "center",
11
- alignItems: "center",
12
- minHeight: "40vh",
13
- p: 4,
14
- }}
15
- >
16
- <Typography variant="h1" component="h1">
17
- <Link
18
- href="https://nextjs.org"
19
- target="_blank"
20
- rel="noopener noreferrer"
21
- >
22
- Next.js
23
- </Link>{" "}
24
- on 🤗{" "}
25
- <Link
26
- href="https://huggingface.co/spaces"
27
- target="_blank"
28
- rel="noopener noreferrer"
29
- >
30
- Spaces
31
- </Link>
32
- </Typography>
33
-
34
- <HighlightBox>
35
- <Typography variant="h5" component="p">
36
- Run your ML demo with ease in a Next.js environment
37
- </Typography>
38
- </HighlightBox>
39
-
40
- <Stack gap={2} direction="row">
41
- <Button
42
- startIcon={<ContentCopyIcon />}
43
- variant="contained"
44
- href="https://huggingface.co/spaces/failfast/nextjs-docker-starter?duplicate=true"
45
- target="_blank"
46
- rel="noopener"
47
- color="secondary"
48
- >
49
- Duplicate space
50
- </Button>
51
-
52
- <Button
53
- href="https://github.com/failfa-st/nextjs-docker-starter"
54
- target="_blank"
55
- rel="noopener"
56
- >
57
- Contribute on GitHub
58
- </Button>
59
- </Stack>
60
- </Stack>
61
- );
62
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/components/under-construction.tsx DELETED
@@ -1,8 +0,0 @@
1
- import { styled } from "@mui/material/styles";
2
-
3
- export const UnderConstruction = styled("div")({
4
- width: "100%",
5
- height: "266px",
6
- backgroundRepeat: "round",
7
- backgroundImage: `url("data:image/gif;base64,R0lGODlhCgEKAfECAAAAAP/dAP///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCAACACwAAAAACgEKAQAC/5SPqcvtD6OUoNqLs568+w+G4kiWnoaml8m27gvHsqHW24zn+s6f9l/pCYfEYgsINCqXzOYB+XNKp9QY1FbNareNq/fGDYuN37JljE7vzGa1++1il+H0Okj+tev3D7yXDxhI4wclaKgGFKC4yNjo+Jh0KDmV+Gh5uRg5ublUifnZqMk5OuQJeipKqqpjevqZuhpr9ePqCiuLy9Jaa3mb+zuxyzucGQV87CBMPOyLjKy8XNvsDAwdjWpMrS1gff2ave3c7X05HR47Tg4Jfq6arr5s3m73Ds/MPh9Yby+Nn8+3jx82LP8MBRT4jWBBfbQQ2pO3EFFDh+ogRsxykOI1i/8XlWTUGM9fR0oTQZrkOJLIR5O8UKYUspKlLZEvmcSUCcplzTUlcSLUuTNOT59EFQENemdoUZ9HkfqwsTRqgKZOOdyUSoxqVQpKsYLUuhXCVa/9FIaFMZbswBpnT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Jvs83I3SSSJuPk5ucb5ukK7Ofu6eA28uT0Ffbz+Hj62/z+/MX4QdAMEJJFgwm8AHCBOqWchQhcM3EB00nAin4kWMgH40SuSYseKqbSK7kCxpwxrKcNRW9lDpUtrJmM1metyBk4E4mgJy+lSwk+ZPn0FjDs1Z1OVRnElXLt2YjOfTj/2EUs2zlOcEqGqyah14lY7XrxE/9PJJFgLXIz/TltU5a6hbi2HfjJ0LIxfeEXr3hujrVwPgwBgGE7Zg+DCFpQUAACH5BAUBAAIALDgARgCTAGIAAAL/lI+py+0Po5wK2Isx3bz7D2biBZbmiUbjmLbu260iTNf2IWf3zp+51gsKJz/S8HgbBZbMQNGCjNKUzeUTIM22qNWr9mviNr3gckxUtT7NbIqYSW7LHW91cY7P6/f8vv8PGCg4SFhoeIgIwZIouMgI6PjoFynJR1mpd4mJp7kpV+c04ykF2jnKUyp6epSqs8qKlmb6WtMKRBtka4QbFpv2K6vKG+ILbBzqOkyccdw8q6xS3BycDH3GPA38bE0nnQ0nzO3m/Y18+/BrrQuVkg69jtWepk6+TeGuDN+CP6wvX0UPW5dwJfjxgleO2jlxSOwxrEXwYa6IElFRrJjkIkaIu9U2WrwCMqTIkSRLmjyJMqXKlSxbunwJM6bMmTRr2ryJM6fOnTx7+vxpE88vUAmn0fwzlFxRZzORKrywtOhRP0kFRs02tU9VDFfLZeWzFWpXrE2pPrUwlqzMV2kBeuTQtslbuHGXzN1Q1+7dCXkD7OWb96+EvoL/9W3293C2xIoR723s+C7kY4wnG/RoGVjlzHIfc3Yr+XPn0KL1ki69WXTqz4U7dG1NNypsvFdn36ttezDu3BBe8+5tuQAAOw==")`,
8
- });
 
 
 
 
 
 
 
 
 
src/pages/api/get_file_list.ts ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import process from "node:process";
2
+ import { NextApiRequest, NextApiResponse } from "next";
3
+
4
+ export default async function handler(
5
+ request: NextApiRequest,
6
+ response: NextApiResponse
7
+ ) {
8
+
9
+ return response.status(200).json({ file_list: [123] });
10
+ }
src/pages/index.tsx CHANGED
@@ -1,14 +1,17 @@
1
  import Head from "next/head";
2
  import Container from "@mui/material/Container";
3
- import Footer from "@/components/footer";
4
- import Title from "@/components/title";
5
- import Huggingface from "@/components/huggingface/huggingface";
6
- import GettingStarted from "@/components/getting-started";
7
- import ExampleComponents from "@/components/example-components";
8
  import { Stack } from "@mui/material";
9
  import { DividerBox } from "@/components/base/boxes";
 
10
 
11
  export default function Home() {
 
 
 
 
 
 
 
12
  return (
13
  <>
14
  <Head>
@@ -19,17 +22,11 @@ export default function Home() {
19
 
20
  <Container component="main" sx={{ minHeight: "90vh" }}>
21
  <Stack spacing={4} useFlexGap>
22
- <Title />
23
 
24
- <GettingStarted />
25
-
26
- <DividerBox />
27
-
28
- <ExampleComponents />
29
  </Stack>
30
  </Container>
31
 
32
- <Footer />
33
  </>
34
  );
35
  }
 
1
  import Head from "next/head";
2
  import Container from "@mui/material/Container";
 
 
 
 
 
3
  import { Stack } from "@mui/material";
4
  import { DividerBox } from "@/components/base/boxes";
5
+ import { useEffect, useState } from "react";
6
 
7
  export default function Home() {
8
+ const [data, setData] = useState(0)
9
+ useEffect(() => {
10
+ (async () => {
11
+ const res= (await ((await fetch('/api/get_file_list')).json()))
12
+ setData(res.file_list[0]);
13
+ })()
14
+ }, [])
15
  return (
16
  <>
17
  <Head>
 
22
 
23
  <Container component="main" sx={{ minHeight: "90vh" }}>
24
  <Stack spacing={4} useFlexGap>
25
+ {data}
26
 
 
 
 
 
 
27
  </Stack>
28
  </Container>
29
 
 
30
  </>
31
  );
32
  }