radames commited on
Commit
8dfb83d
1 Parent(s): 06dc463

Upload 16 files

Browse files
Files changed (5) hide show
  1. Dockerfile +6 -4
  2. README.md +38 -11
  3. package-lock.json +0 -0
  4. package.json +1 -1
  5. vite.config.js +0 -8
Dockerfile CHANGED
@@ -19,15 +19,17 @@ WORKDIR /app
19
  COPY --from=deps --link /app/node_modules ./node_modules
20
  COPY --link . .
21
 
22
- RUN npm run build
23
- # && npm prune --production
24
 
25
  ENV NODE_ENV=production
26
 
 
27
  EXPOSE 3000
 
 
28
  # Allow the running process to write model files to the cache folder.
29
  # NOTE: In practice, you would probably want to pre-download the model files to avoid having to download them on-the-fly.
30
  RUN mkdir -p /app/node_modules/@xenova/.cache/
31
- RUN chmod 777 -R /app
32
 
33
- CMD ["npm", "run", "preview"]
 
19
  COPY --from=deps --link /app/node_modules ./node_modules
20
  COPY --link . .
21
 
22
+ RUN npm run build && npm prune --production
 
23
 
24
  ENV NODE_ENV=production
25
 
26
+ COPY --link package.json .
27
  EXPOSE 3000
28
+
29
+
30
  # Allow the running process to write model files to the cache folder.
31
  # NOTE: In practice, you would probably want to pre-download the model files to avoid having to download them on-the-fly.
32
  RUN mkdir -p /app/node_modules/@xenova/.cache/
33
+ RUN chmod 777 -R /app/node_modules/@xenova/
34
 
35
+ CMD ["node", "build"]
README.md CHANGED
@@ -1,11 +1,38 @@
1
- ---
2
- title: Transformers Js Sveltekit Server Example App
3
- emoji: 📈
4
- colorFrom: blue
5
- colorTo: pink
6
- sdk: docker
7
- app_port: 3000
8
- pinned: false
9
- ---
10
-
11
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # create-svelte
2
+
3
+ Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
4
+
5
+ ## Creating a project
6
+
7
+ If you're seeing this, you've probably already done this step. Congrats!
8
+
9
+ ```bash
10
+ # create a new project in the current directory
11
+ npm create svelte@latest
12
+
13
+ # create a new project in my-app
14
+ npm create svelte@latest my-app
15
+ ```
16
+
17
+ ## Developing
18
+
19
+ Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
20
+
21
+ ```bash
22
+ npm run dev
23
+
24
+ # or start the server and open the app in a new browser tab
25
+ npm run dev -- --open
26
+ ```
27
+
28
+ ## Building
29
+
30
+ To create a production version of your app:
31
+
32
+ ```bash
33
+ npm run build
34
+ ```
35
+
36
+ You can preview the production build with `npm run preview`.
37
+
38
+ > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
package-lock.json CHANGED
The diff for this file is too large to render. See raw diff
 
package.json CHANGED
@@ -9,7 +9,7 @@
9
  "lint": "prettier --plugin-search-dir . --check . && eslint .",
10
  "format": "prettier --plugin-search-dir . --write ."
11
  },
12
- "devDependencies": {
13
  "@sveltejs/adapter-node": "^1.3.1",
14
  "@sveltejs/kit": "^1.20.4",
15
  "@xenova/transformers": "^2.5.2",
 
9
  "lint": "prettier --plugin-search-dir . --check . && eslint .",
10
  "format": "prettier --plugin-search-dir . --write ."
11
  },
12
+ "dependencies": {
13
  "@sveltejs/adapter-node": "^1.3.1",
14
  "@sveltejs/kit": "^1.20.4",
15
  "@xenova/transformers": "^2.5.2",
vite.config.js CHANGED
@@ -3,12 +3,4 @@ import { defineConfig } from 'vite';
3
 
4
  export default defineConfig({
5
  plugins: [sveltekit()]
6
- // optimizeDeps: {
7
- // exclude: ['sharp', 'onnxruntime-node']
8
- // },
9
- // build: {
10
- // rollupOptions: {
11
- // external: ['sharp', 'onnxruntime-node']
12
- // }
13
- // }
14
  });
 
3
 
4
  export default defineConfig({
5
  plugins: [sveltekit()]
 
 
 
 
 
 
 
 
6
  });