Comments (3)
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:
DataDreamer/src/llms/hf_api_endpoint.py
Line 87 in 98a8347
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.
Perfect, yep, I can explain those, the answers are a little complicated.
- Even though you are specifying
lazy=False
, yourPrompt
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.
- 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.
@AjayP13 Thanks! This helps with my issue to use TGI. Two follow-up questions -
- 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 seeget_generated_texts called
printed 6 times - 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)
- Issues with installation HOT 1
- Too many open files in system HOT 1
- Add support for "guidance" and "outlines" HOT 3
- Can we use the azure gpt key? HOT 4
- MistralAI Read Timeout HOT 1
- Together 524 Server Error Exception HOT 1
- Anthropic Claude 3 invalid_request_error Exception HOT 2
- gpt-4-turbo-preview max_tokens error HOT 1
- UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 100: ordinal not in range(128) HOT 2
- Is there a specific reason to not let run the trainer in memory? HOT 4
- Does this work deal with the workload balance when scheduing? HOT 5
- How to install from the souce code? HOT 6
- Question about the speed HOT 2
- TRL version requirement HOT 4
- How to parse hugging face datasets or dataframe to ProcessWithPrompt input?
- seed parameter error when use DataDreamer with VLLM HOT 1
- DataDreamer is not working under windows HOT 2
- VLLM assert isinstance(self.device, list) error HOT 2
- error while using HFAPIEndpoint HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datadreamer.