Code Monkey home page Code Monkey logo

Comments (5)

lbeurerkellner avatar lbeurerkellner commented on August 29, 2024

I think there may be an issue with worker threads being shut down after the first completion. I will investigate a bit and report here.

For now, usually when running multiple queries in sequence, I would suggest a pattern like this:

async def main():
   l = []
   await s(l, "some text")
   await s(l, "some text")

asyncio.run(main)

from lmql.

gamendez98 avatar gamendez98 commented on August 29, 2024

Thank you for the quick answer. sadly I am calling the functions from within a RabbitMq callback that I cannot make async and since I the function gets called for each message I need a way to transition more than once from non-async to async

from lmql.

lbeurerkellner avatar lbeurerkellner commented on August 29, 2024

I see. For this you may want to have a look at how we bridge async/non-async for langchain integration, see https://github.com/eth-sri/lmql/blob/main/src/lmql/runtime/langchain.py

Bascially, if possible try re-using the event loop. Still, I will see what I can do to enable your initial use.

from lmql.

gamendez98 avatar gamendez98 commented on August 29, 2024

Thanks a lot!! I am triying to see exactly where it gets locked to have a better idea on whats happening
so far it gets locked on
lmql/runtime/bopenai/batched_openai.py :675
PS I am using version 0.0.5.1

from lmql.

gamendez98 avatar gamendez98 commented on August 29, 2024

It worked thanks!!

from lmql.

Related Issues (20)

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.