Git Product home page Git Product logo

Comments (3)

AjayP13 avatar AjayP13 commented on May 19, 2024 1

Hi, thanks for looking at integrating this. Before looking at this further, we do actually have TGI support I believe.

See the HFAPIEndpoint class: https://datadreamer.dev/docs/latest/datadreamer.llms.html#datadreamer.llms.HFAPIEndpoint

You can see that it uses InferenceClient from huggingface_hub under the hood:

return InferenceClient(model=self.endpoint, token=self.token, **self.kwargs)

which is compatible with TGI according to this page: https://huggingface.co/docs/text-generation-inference/en/basic_tutorials/consuming_tgi#inference-client

Does this solve your need?

from datadreamer.

AjayP13 avatar AjayP13 commented on May 19, 2024 1

Perfect, yep, I can explain those, the answers are a little complicated.

  1. Even though you are specifying lazy=False, your Prompt step is indeed running lazily due to the :memory: option (in that code path it actually requires a folder to write results.) When a step is run lazily, internally we call the iterator backing the lazy result just to get the first element (a "peek" operation) in order to check what it's type is, since we can't detect the type with an iterator. So the extra calls are coming from these "peek" operations. You generally don't need to be concerned with those though for your implementation though as an end user and they don't add any significant overhead for two reasons: 1) these peeks only read the first element, so if your lazy iterator returns 1 million rows, only the first element is read, so the overhead doesn't scale with the number of rows 2) results from the LLM are cached.

I can work on trying to see if I can remove that constraint so it doesn't run lazily in the future though. I will take this up as an enhancement.

  1. No examples at this time other than this page, but I think this page should have everything you need: https://datadreamer.dev/docs/latest/pages/advanced_usage/creating_a_new_datadreamer_.../step.html

and feel free to ask any questions if you run into any trouble.

from datadreamer.

gopalsarda avatar gopalsarda commented on May 19, 2024

@AjayP13 Thanks! This helps with my issue to use TGI. Two follow-up questions -

  1. I am planning to implement some custom steps for my use-case so trying to understand what was the issue with my test script. Why do I see get_generated_texts called printed 6 times
  2. I am interested in implementing a SuperStep to generate multi-turn synthetic data. Do you have any examples I can refer to?

from datadreamer.

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.