Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate output #4

Open
craftzdog opened this issue Apr 4, 2023 · 8 comments
Open

Duplicate output #4

craftzdog opened this issue Apr 4, 2023 · 8 comments

Comments

@craftzdog
Copy link

When I run the command, it outputs duplicate results like so:

Screenshot 2023-04-04 at 12 33 40

Reproduction

Write a note:

How to read a file in Python? Can you give me an example in Markdown?

Run the plugin command.

@shubham8550
Copy link
Owner

I Think Socket Listner got initialized twice for some reason ill look into it

Originally I directly wanted to use Dalai as a dependency of the plugin so users don't have to start the server and i don't have to deal with sockets but Inkdrop is not able to install it

I'll fix socket this socket thing (it might be happening when you restart ink drop , listener getting reregistered so I just have to make sure when ink drop closes all socket events get destroyed )

@shubham8550
Copy link
Owner

if you can help me get Dalai to work it will be great

so ill just use something like this
image

req PR :)

@craftzdog
Copy link
Author

I guess you should unbind the result event handler after finishing receiving the response from the AI here:

socket.on("result", (data) => {

@craftzdog
Copy link
Author

Originally I directly wanted to use Dalai as a dependency of the plugin so users don't have to start the server and i don't have to deal with sockets but Inkdrop is not able to install it

I don't have much time for looking into it deeper, sorry. (I'm currently busy on this)
But if you give me a specific error or something, maybe I can help you.

@shubham8550
Copy link
Owner

image

i am getting output for line 40

dalai.installed().then(console.log)

so we can say dalai is successfully imported but
when we try to fire up model with

dalai.request({

        model: "alpaca.7B",
        prompt: "The following is a conversation between a boy and a girl:",
        }, (token) => {
        console.log(token);
        })

we get that error

@craftzdog
Copy link
Author

Looks like it requires a NodeJS native module conpty.node.
Those native modules should match the ABI version of the Electron.
Can you try running the following command in the plugin root directory?

ipm rebuild

@shubham8550
Copy link
Owner

Looks like it requires a NodeJS native module conpty.node. Those native modules should match the ABI version of the Electron. Can you try running the following command in the plugin root directory?

ipm rebuild

this didn't work but I tried something else to deal with this issue now i know a way to make this extension better

ill rewrite this extension with more functionality and proper code (not mess)

@craftzdog
Copy link
Author

Yeah, I found that requiring native modules in the renderer process is deprecated in the recent Electron.

Looking forward to seeing the new version!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants