datadreamer-dev / DataDreamer

DataDreamer: Prompt. Generate Synthetic Data. Train & Align Models.   🤖💤
https://datadreamer.dev
MIT License
724 stars 39 forks source link

How to install from the souce code? #18

Closed andakai closed 3 months ago

andakai commented 3 months ago

I have found that I can change the src code and test it in tests.

How can I install from the source code and use in other directories like:

from datadreamer.llms import VLLM, ParallelLLM
from datadreamer import DataDreamer
AjayP13 commented 3 months ago

You can follow the instructions here to install from PyPI with pip: https://datadreamer.dev/docs/latest/#

And there are some examples of how the package can be used on the Quick Tour page: https://datadreamer.dev/docs/latest/pages/get_started/quick_tour/index.html

Then you can use the code from the test case as an example of how to modify some of the Quick Tour examples to do what you need.

andakai commented 3 months ago

Sorry that I didn't clarify my need. I want to modify some codes in the src, and then install the new version as a wheel, so that I can use

from datadreamer.llms import VLLM, ParallelLLM
from datadreamer import DataDreamer

in other directories, not only in the /src/tests.

AjayP13 commented 3 months ago

You don't need to modify the package, it already comes with these built in:

from datadreamer.llms import VLLM, ParallelLLM
from datadreamer import DataDreamer

See the VLLM & ParallelLLM class in the documentation: https://datadreamer.dev/docs/latest/datadreamer.llms.html#datadreamer.llms.VLLM https://datadreamer.dev/docs/latest/datadreamer.llms.html#datadreamer.llms.ParallelLLM

andakai commented 3 months ago

Sorry again for the my unclear expression and I am new to programming. I want to modify some codes in datadreamer.llms.VLLM to satisfy my personal need, and I want to use the modified codes in other directories. As in vllm project, I can use pip install -e . to install from source. I wonder whether there is similar way for datadreamer.

AjayP13 commented 3 months ago

Oh I see, we don't have great support for editing & locally installing like that unfortunately. Mainly expecting people to install via PyPI. There are two options you can try:

1) Install from PyPI and then edit the files in the install location: For example, first install via pip install datadreamer.dev and then you can do this to find where to edit the files:

image

2) Sub-class and extend the classes you wish to edit: If your edits / changes can be handled by sub-classing and you're comfortable doing that, you could also just subclass whatever class you need to edit like VLLM and override the methods.

andakai commented 3 months ago

Thanks! These two methods exactly solve my problem. Thanks for your patient answers and I learn a lot.