cocktailpeanut / dalai

The simplest way to run LLaMA on your local machine
https://cocktailpeanut.github.io/dalai
13.1k stars 1.42k forks source link

TypeError: Cannot read properties of undefined (reading 'split') #401

Open Deadlydav opened 1 year ago

Deadlydav commented 1 year ago

no idea why kinda noob but its been 2 days of trying different things and i have this error install fine i think able to connect to localhost but when prompted it crash and give be this i got this error on 3 machine 2 are vm for what i understand it may be a undefined variable but i have no clue how to find and fix this

TypeError: Cannot read properties of undefined (reading 'split') at Dalai.query (/root/.npm/_npx/3c737cbb02d79cc9/node_modules/dalai/index.js:219:35) at Socket. (/root/.npm/_npx/3c737cbb02d79cc9/node_modules/dalai/index.js:534:20) at Socket.emit (node:events:513:28) at Socket.emitUntyped (/root/.npm/_npx/3c737cbb02d79cc9/node_modules/socket.io/dist/typed-events.js:69:22) at /root/.npm/_npx/3c737cbb02d79cc9/node_modules/socket.io/dist/socket.js:703:39 at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

DavideWiest commented 1 year ago

Maybe you didnt select a model. I have the same problem, but cant select any model

Deadlydav commented 1 year ago

i selected a model tryed with all exept the llama 65B the alpaca's one seems to work but i wanted llama

seyfer commented 1 year ago

I have the same issue

when installed with docker compose run dalai npx dalai alpaca install 7B

this is the error

docker compose up
[+] Running 1/0
 ⠿ Container dalai-dalai-1  Created                                                                                                                                                                           0.0s
Attaching to dalai-dalai-1
dalai-dalai-1  | mkdir /root/dalai
dalai-dalai-1  | Server running on http://localhost:3000/
dalai-dalai-1  | > query: {
dalai-dalai-1  |   seed: -1,
dalai-dalai-1  |   threads: '1',
dalai-dalai-1  |   n_predict: 200,
dalai-dalai-1  |   top_k: 40,
dalai-dalai-1  |   top_p: 0.9,
dalai-dalai-1  |   temp: 0.8,
dalai-dalai-1  |   repeat_last_n: 64,
dalai-dalai-1  |   repeat_penalty: 1.3,
dalai-dalai-1  |   debug: true,
dalai-dalai-1  |   models: [ 'alpaca.7B' ],
dalai-dalai-1  |   prompt: 'hello',
dalai-dalai-1  |   id: null
dalai-dalai-1  | }
dalai-dalai-1  | /root/dalai/node_modules/dalai/index.js:219
dalai-dalai-1  |     let [Core, Model] = req.model.split(".")
dalai-dalai-1  |                                   ^
dalai-dalai-1  | 
dalai-dalai-1  | TypeError: Cannot read properties of undefined (reading 'split')
dalai-dalai-1  |     at Dalai.query (/root/dalai/node_modules/dalai/index.js:219:35)
ignis32 commented 1 year ago

I have the same issue. It helped me to use Edge instead of Chrome, and I do not understand what is a root cause. Running Chrome causes dalai to crash.

 let [Core, Model] = req.model.split(".")
                                  ^

TypeError: Cannot read properties of undefined (reading 'split')
    at Dalai.query (/home/ignis/.npm/_npx/3c737cbb02d79cc9/node_modules/dalai/index.js:219:35)
    at Socket.<anonymous> (/home/ignis/.npm/_npx/3c737cbb02d79cc9/node_modules/dalai/index.js:534:20)
    at Socket.emit (node:events:513:28)
    at Socket.emitUntyped (/home/ignis/.npm/_npx/3c737cbb02d79cc9/node_modules/socket.io/dist/typed-events.js:69:22)
    at /home/ignis/.npm/_npx/3c737cbb02d79cc9/node_modules/socket.io/dist/socket.js:703:39
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

UPD: Okay, looks like i've figured it out. Seems like something is getting corrupted in the browser site stored data. Clearing browser cookies/data/localstorage/whatever helps.