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

Add RWKV example #24

Closed
wants to merge 2 commits into from
Closed

Add RWKV example #24

wants to merge 2 commits into from

Conversation

Nintorac
Copy link
Contributor

No description provided.

@lhenault
Copy link
Owner

I've a complicated relationship with conda these days, so if you want an "Anaconda free" Dockerfile you can look at my latest changes to other examples to use Python3.9+ here. Otherwise LGTM, happy to finally merge :)

@cahya-wirawan
Copy link

@Nintorac what is the difference between chat and complete function in lib_raven.py?

@cahya-wirawan
Copy link

In the chat code at BlinkDL/RWKV-LM, there is a check where it will stop to generate text after it sees double new line "\n\n", would you also implement it? or will you prefer to check the "Bob:" to stop the generation instead of "\n\n", since there is possibility that the generated text could include "\n\n" without followed by "Bob:" for example if I ask the chat bot to write code, it will generate "\n\n" before any code.

@Nintorac
Copy link
Contributor Author

@Nintorac what is the difference between chat and complete function in lib_raven.py?

nothing apparently 😓

In the chat code at BlinkDL/RWKV-LM, there is a check where it will stop to generate text after it sees double new line "\n\n", would you also implement it? or will you prefer to check the "Bob:" to stop the generation instead of "\n\n", since there is possibility that the generated text could include "\n\n" without followed by "Bob:" for example if I ask the chat bot to write code, it will generate "\n\n" before any code.

No, won't implement that. The OpenAI API has a stop words argument which I had a go at implementing. I had it working locally and was going to upstream to chatrwkv repo but work has picked up so lost that thread for now

@Nintorac
Copy link
Contributor Author

@cahya-wirawan got motivated and finished off the stop words code see here - BlinkDL/ChatRWKV#106

@cahya-wirawan
Copy link

@Nintorac have you tried the embedding function and tested if it create similar vector for two similar sentences?

@Nintorac
Copy link
Contributor Author

Nintorac commented May 12, 2023

@Nintorac have you tried the embedding function and tested if it create similar vector for two similar sentences?

Have been working towards this but no luck so far. The langchain QA chain uses deprecated openai endpoints and simpleAI does not implement them.

Working on batched inference (and generations) at the moment as I thought it would be more widely beneficial and didn't want to have build the vector store one by one

@Nintorac Nintorac closed this May 12, 2023
@Nintorac Nintorac reopened this May 12, 2023
@cahya-wirawan
Copy link

Working on batched inference (and generations) at the moment as I thought it would be more widely beneficial and didn't want to have build the vector store one by one

Yes, I am wondering about following code, why context is created from a list of inputs, but at the end only the first one is used:

    context = [pipeline.encode(ctx)[-ctx_limit:] for ctx in inputs]
    _, state = model.forward(context[0], None)

@Nintorac
Copy link
Contributor Author

Closing in favour of https://github.com/Nintorac/simple_rwkv :)

Yes, I am wondering about following code, why context is created from a list of inputs, but at the end only the first one is used:

premature optimisation ><

Parallel can work now though BlinkDL/ChatRWKV#113

@Nintorac Nintorac closed this May 14, 2023
@lhenault
Copy link
Owner

Closing in favour of https://github.com/Nintorac/simple_rwkv :)

I should have been faster reviewing and merging this PR I guess, but won't hold a grudge. Solid work still, gave it its first star :)

@cahya-wirawan
Copy link

cahya-wirawan commented May 15, 2023

Closing in favour of https://github.com/Nintorac/simple_rwkv :)

I should have been faster reviewing and merging this PR I guess, but won't hold a grudge. Solid work still, gave it its first star :)

You could still reopen the PR and merge it if you like and @Nintorac agree with it I guess :-)

@Nintorac
Copy link
Contributor Author

Yea, no problem to still merging it I tried to leave it in a good state here. My plans just got bigger!

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

Successfully merging this pull request may close these issues.

3 participants