Code Monkey home page Code Monkey logo

chatty's Introduction

chatty's People

Contributors

huntabyte avatar waynemorganuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatty's Issues

Problem

I want to put it on my own VPS instead of vercel to use it, but when I go there it won't load the page. Can you tell me how to do it?

`tokenizer.ts` doesn't need a conditional import if you're using Vite's default bundler

tokenizer.ts doesn't need a conditional import if you're using Vite (npm run dev), but it is necessary when using (npm run build --debug && npm run preview).

So, why does tokenizer.ts require this conditional check to import GPT3TokenizerImport?

The code below (from the GitHub issue mentioned in the video), checks if you're using CommonJS or not.

const GPT3Tokenizer: typeof GPT3TokenizerImport =
 typeof GPT3TokenizerImport === 'function'
 ? GPT3TokenizerImport
 : (GPT3TokenizerImport as any).default

However – the following Just Works™️ when you're in npm run dev in Vite because it can handle mixed import syntax from ES6 module imports and CommonJS:

// $lib/tokenizer.ts
import GPT3Tokenizer from 'gpt3-tokenizer';

const tokenizer = new GPT3Tokenizer({ type: 'gpt3' });

export function getTokens(input: string): number {
  const tokens = tokenizer.encode(input);
  return tokens.text.length;
}

I hope this helps.

"error":"There was an error processing your request"

So, i´ve tryed every step in the instalation method you but for some reason is failing.

This is what the error returns :

Untitled

Some remarks :

  • i´ve use npm instead of pnpm, is there any different ?
  • Im running in the localhost:5173
  • Try it in chrome and edge.

For your reference, here are my system specifications:

  • NVIDIA GTX 3060 Ti
  • 16GB RAM
  • 1TB SSD
  • AMD Ryzen 5 1600 Six-Core Processor
  • Windows 10

Thank you in advance for your assistance.
Sincerely.

JPupper

font error[FATAL ERROR]

D:\AI\npm2\chatty>npm run dev -- --open

[email protected] dev
vite dev --open

VITE v4.1.4 ready in 1228 ms

➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h to show help
11:01:36 AM [vite-plugin-svelte] ssr compile in progress ...

🌼 daisyUI components 2.51.3 https://daisyui.com
✔︎ Including: base, components, 29 themes, utilities
❤︎ Support daisyUI: https://opencollective.com/daisyui

[postcss] Failed to find '@fontsource/fira-mono'
in [
D:/AI/npm2/chatty/src/routes
]
Internal server error: [postcss] Failed to find '@fontsource/fira-mono'
in [
D:/AI/npm2/chatty/src/routes
]
Plugin: vite:css
File: D:/AI/npm2/chatty/src/routes/styles.css:undefined:undefined
at file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-53dc1ef4.js:93:13
at async Promise.all (index 0)
at async LazyResult.runAsync (D:\AI\npm2\chatty\node_modules\postcss\lib\lazy-result.js:396:11)
at async compileCSS (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:36736:25)
at async TransformContext.transform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:36197:56)
at async Object.transform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:41685:30)
at async loadAndTransform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:39479:29)
Error: [postcss] Failed to find '@fontsource/fira-mono'
in [
D:/AI/npm2/chatty/src/routes
]
at file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-53dc1ef4.js:93:13
at async Promise.all (index 0)
at async LazyResult.runAsync (D:\AI\npm2\chatty\node_modules\postcss\lib\lazy-result.js:396:11)
at async compileCSS (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:36736:25)
at async TransformContext.transform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:36197:56)
at async Object.transform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:41685:30)
at async loadAndTransform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:39479:29)
Internal server error: [postcss] Failed to find '@fontsource/fira-mono'
in [
D:/AI/npm2/chatty/src/routes
]
Plugin: vite:css
File: D:/AI/npm2/chatty/src/routes/styles.css:undefined:undefined
at file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-53dc1ef4.js:93:13
at async Promise.all (index 0)
at async LazyResult.runAsync (D:\AI\npm2\chatty\node_modules\postcss\lib\lazy-result.js:396:11)
at async compileCSS (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:36736:25)
at async TransformContext.transform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:36197:56)
at async Object.transform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:41685:30)
at async loadAndTransform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:39479:29) (x2)
Error: [postcss] Failed to find '@fontsource/fira-mono'
in [
D:/AI/npm2/chatty/src/routes
]
at file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-53dc1ef4.js:93:13
at async Promise.all (index 0)
at async LazyResult.runAsync (D:\AI\npm2\chatty\node_modules\postcss\lib\lazy-result.js:396:11)
at async compileCSS (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:36736:25)
at async TransformContext.transform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:36197:56)
at async Object.transform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:41685:30)
at async loadAndTransform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:39479:29)
Error: Not found: /favicon.ico
at resolve (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:394:13)
at resolve (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:243:5)
at #options.hooks.handle (/@fs/D:/AI/npm2/chatty/node_modules/@sveltejs/kit/src/runtime/server/index.js:41:55)
at Module.respond (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:240:40)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Internal server error: [postcss] Failed to find '@fontsource/fira-mono'
in [
D:/AI/npm2/chatty/src/routes
]
Plugin: vite:css
File: D:/AI/npm2/chatty/src/routes/styles.css:undefined:undefined
at file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-53dc1ef4.js:93:13
at async Promise.all (index 0)
at async LazyResult.runAsync (D:\AI\npm2\chatty\node_modules\postcss\lib\lazy-result.js:396:11)
at async compileCSS (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:36736:25)
at async TransformContext.transform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:36197:56)
at async Object.transform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:41685:30)
at async loadAndTransform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:39479:29) (x3)
Error: [postcss] Failed to find '@fontsource/fira-mono'
in [
D:/AI/npm2/chatty/src/routes
]
at file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-53dc1ef4.js:93:13
at async Promise.all (index 0)
at async LazyResult.runAsync (D:\AI\npm2\chatty\node_modules\postcss\lib\lazy-result.js:396:11)
at async compileCSS (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:36736:25)
at async TransformContext.transform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:36197:56)
at async Object.transform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:41685:30)
at async loadAndTransform (file:///D:/AI/npm2/chatty/node_modules/vite/dist/node/chunks/dep-ca21228b.js:39479:29)

Unexpected reserved word

Hello, amazing repo and vid.

I'm running into the following error when running npm create svelte@latest:

file:///home/user/.npm/_npx/50a6160ffc29bafc/node_modules/create-svelte/bin.js:19
	const dir = await p.text({
	            ^^^^^

SyntaxError: Unexpected reserved word
    at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
    at async link (internal/modules/esm/module_job.js:42:21)
npm ERR! code 1
npm ERR! path /home/user/chatty
npm ERR! command failed
npm ERR! command sh -c create-svelte

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2023-03-09T07_40_03_462Z-debug-0.log

Any ideas how can I fix it?
Thanks

Catching all errors with messages

Another exceptional sveltekit tutorial. Just one issue with regard to catching errors. adding the follwing code to +server.ts at line 47 catches an error if for example you have an invalid api key

if (!moderationRes.ok) {
    const err = await moderationRes.json()
    throw new Error(err.error.message)
}

also using throw new Error(err.error.message) in line 86 gives a message when you call console.error rather than [ object, object]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.