Spaces:
Running
title: Translator Tamagui
emoji: π»
colorFrom: green
colorTo: red
sdk: static
pinned: true
license: wtfpl
models:
- Xenova/nllb-200-distilled-600M
- huuquyet/vinai-translate-vi2en-v2
- huuquyet/vinai-translate-en2vi-v2
- huuquyet/envit5-translation
short_description: Translator demo App built with Transformers.js + Tamagui
Translator demo App built with Transformers.js + Tamagui + Next.js
π¦ About
This Translator app is a starter for a Transformers.js + Tamagui + Next.js
Please check out the demo site or Vercel app.
Included models
- Xenova/nllb-200-distilled-600M
- vinai-translate-vi2en-v2 onnx model converted from vinai-translate-vi2en-v2
- vinai-translate-en2vi-v2 onnx model converted from vinai-translate-en2vi-v2
- envit5-translation onnx model converted from envit5-translation
π¦ Included packages
- Transformers.js
- Tamagui πͺ
- Next.js
π Folder layout
The main apps are:
src
all the components and screens
π Start the app
Clone the repo and install dependencies:
git clone https://github.com/huuquyet/translator-tamagui.git cd translator-tamagui yarn install
Run the development server:
yarn dev
Firefox users need to change the
dom.workers.modules.enabled
setting inabout:config
totrue
to enable Web Workers. Check out this issue for more details.Open the link (e.g., http://localhost:3000/) in your browser.
π Add new dependencies
Pure JS dependencies
If you're installing a JavaScript-only dependency that will be used across platforms, install it :
yarn add zustand
Update new dependencies
Pure JS dependencies
yarn upgrade-interactive
You may potentially want to have the native module transpiled for the next app. If you get error messages with Cannot use import statement outside a module
, you may need to use transpilePackages
in your next.config.js
and add the module to the array there.
Deploying to Vercel
- Install vercel cli (if not):
npm i -g vercel
- Login to vercel:
vercel login
- Build command to be
vercel build
(add--prod
if wanna build production version) - Build command: leave default setting
- Output dir: leave default setting
- Deploy to vercel:
vercel --prebuilt
(add--prod
if wanna deploy to production)