项目介绍

replicate/getting-started-nextjs-language 是一个托管在 GitHub 上的开源项目,主要使用 JavaScript 编写,目前获得 26 个 Star、4 次 Fork。

仓库全名
replicate/getting-started-nextjs-language
Star 数
26
Fork 数
4

README 摘要

Next.js template for running language models with Replicate This is a Next.js template project that's preconfigured for interacting with a language model like FLAN-T5 with Replicate's API. You can use this as a quick jumping-off point to build a web app using Replicate's API, or you can recreate this codebase from scratch by following the guide at replicate.com/docs/get-started/nextjs Noteworthy files pages/index.js…

完整内容见 GitHub 原始 README 或本页 。

常见问题

getting-started-nextjs-language 用什么语言开发?

主要使用 JavaScript 编写,目前有 26 个 Star。

如何获取 getting-started-nextjs-language 的源码?

可以直接克隆仓库:git clone https://github.com/replicate/getting-started-nextjs-language.git;安装与运行步骤见仓库 README。

getting-started-nextjs-language 最近还在维护吗?

仓库最近一次更新为 2023年3月14日,当前没有未关闭的 Issue;Star 数为 26,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

A template Next.js app for running language models like FLAN-T5 with Replicate's API

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
60
价值分
19
活跃状态
活跃

语言占比

CSS
JavaScript

贡献者

README

Next.js template for running language models with Replicate

This is a Next.js template project that’s preconfigured for interacting with a language model like FLAN-T5 with Replicate’s API.

You can use this as a quick jumping-off point to build a web app using Replicate’s API, or you can recreate this codebase from scratch by following the guide at replicate.com/docs/get-started/nextjs

Screenshot 2023-03-13 at 7 00 18 PM

Noteworthy files

Usage

Install dependencies:

npm install

Add your Replicate API token to .env.local:

REPLICATE_API_TOKEN=<your-token-here>

Run the development server:

npm run dev

Open http://localhost:3000 with your browser.

Changing the model

This example app is configured to use the FLAN-T5 model by default, but you can change it to use any other Replicate model that has a similar input and output format.

To change the model, update the modelVersion constant in pages/api/predictions/index.js to the version ID of the Replicate model you want to run.

Editing the homepage

The homepage is a React component in pages/index.js. You can edit it to change the look and feel of the app.

Deploy to Vercel

For detailed instructions on how to create and use this template, see replicate.com/docs/get-started/nextjs

There are many ways to deploy apps to Vercel, but for the sake of brevity, we’ll use the vercel CLI here. Start by installing the CLI and running it:

npx vercel

The command above installs the CLI, then walks you through the process of logging in to Vercel, creating the app, and deploying it. Once you’ve deployed your app, you need to add your Replicate API token to the remote app’s environment variables. This allows your app to make requests to the Replicate API.

vercel env add REPLICATE_API_TOKEN

The command above prompts you to enter a value for your token. Paste your token fron replicate.com/account. You then need to deploy again:

npx vercel deploy --prod

评论

暂无评论