langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Allow parallelize multiple prompts with OpenAIChat

Open joezhoujinjing opened this issue 2 years ago • 6 comments

joezhoujinjing avatar Mar 06 '23 08:03 joezhoujinjing

can you make any changes to the https://github.com/hwchase17/langchain/tree/master/langchain/chat_models class? although im not sure if this is still needed

hwchase17 avatar Mar 06 '23 19:03 hwchase17

can you make any changes to the https://github.com/hwchase17/langchain/tree/master/langchain/chat_models class? although im not sure if this is still needed

Do you mean the problem is now fixed?

joezhoujinjing avatar Mar 06 '23 19:03 joezhoujinjing

ya - can you give it a shot with https://langchain.readthedocs.io/en/latest/modules/chat/getting_started.html

hwchase17 avatar Mar 06 '23 23:03 hwchase17

@hwchase17

am I right in thinking that something like this is still needed to properly solve #1643?

i.e. if we can now do batch messages with ChatOpenAI then that should be used in the map reduce logic in load_summarization_chain et al?

in order to address the 5x slower comment mentioned here: https://github.com/hwchase17/langchain/issues/1643#issuecomment-1471024758

colindotfun avatar Mar 19 '23 22:03 colindotfun

using latest version load_summarization_chain and parallelization for ChatGPT model still does not seem to work. Is there any quick workaround ?

thaiat avatar Apr 08 '23 02:04 thaiat

I am also facing this issue, is there any way to use async to batch calls with gpt-3.5-turbo and map-reduce?

punjabdhaputar avatar Apr 21 '23 00:04 punjabdhaputar

using latest version load_summarization_chain and parallelization for ChatGPT model still does not seem to work. Is there any quick workaround ?

How about use the async and arun for the summarization chain? result = await summary_chain.arun(docs)

mario1in avatar May 29 '23 02:05 mario1in

in that case 2 things happen: 1 - parallelization of the map step, but without concurrency limit so it s causing rate limit for large doc 2 - no parallization for the collapse/reduce steps which make it slower than it should

thaiat avatar May 29 '23 06:05 thaiat

Is there anything new about this topic ? What I can find is :
https://www.youtube.com/watch?v=4RKlNFLEZfk&t=140s

tmishinev avatar Jun 11 '23 19:06 tmishinev

Async is enough。 Good opinion.

fallbackwjj avatar Jun 30 '23 16:06 fallbackwjj

@joezhoujinjing Could you, please, resolve the merging conflict? After that, ping me and I push @hwchase17 to further review. Thanks!

leo-gan avatar Sep 13 '23 00:09 leo-gan

Sure! Let me do it tonight.

joezhoujinjing avatar Sep 13 '23 00:09 joezhoujinjing

Hey @joezhoujinjing ! Closing this due to inactivity, and you're welcome to reopen if you end up resolving those merge conflicts!

efriis avatar Nov 03 '23 22:11 efriis