File size: 1,250 Bytes
6ad1eb1
 
 
 
 
 
 
 
 
 
 
 
9211a2f
6ad1eb1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
title: Next.js + Transformers.js Server Template
emoji: 🗄️
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
app_port: 3000
---

# next-server

This project, bootstrapped using [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app), demonstrates how to use `@huggingface/transformers` in [Next.js](https://nextjs.org).

## Instructions

1. Clone the repository:
   ```sh
   git clone https://github.com/huggingface/transformers.js-examples.git
   ```
2. Change directory to the `next-server` project:
   ```sh
   cd transformers.js-examples/next-server
   ```
3. Install the dependencies:
   ```sh
   npm install
   ```
4. Run the development server:
   ```sh
   npm run dev
   ```
5. Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

6. You can start editing the page by modifying `app/page.js` (Next.js) and `app/api/classify/route.js` (Transformers.js). The page auto-updates as you edit the file.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.