Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

Add functionality for fake data in inference server db

Open wirthual opened this issue 2 years ago • 7 comments

Initial code to add fake data for inference db, tracked by #3090

For simplicity, I used Polyfactory to generate the data.

I faked data for: User, Worker, Chat and Message

The message content is loaded from realistic_seed_data.json

I tested the code from a clean Postgres instance locally. The loading of the data was successful.

Looking forward to any feedback regarding this implementation, needed requirements and testing procedures.

wirthual avatar May 30 '23 21:05 wirthual

:x: pre-commit failed. Please run pre-commit run --all-files locally and commit the changes. Find more information in the repository's CONTRIBUTING.md

github-actions[bot] avatar May 30 '23 21:05 github-actions[bot]

:x: pre-commit failed. Please run pre-commit run --all-files locally and commit the changes. Find more information in the repository's CONTRIBUTING.md

github-actions[bot] avatar Jun 01 '23 19:06 github-actions[bot]

@olliestanley I changed to code based on your feedback. Thank you for that.

Anything else we need to address?

I set this PR to ready.

wirthual avatar Jun 07 '23 15:06 wirthual

Sorry for slow review on this - I think this is looking good, have just left a couple of comments

olliestanley avatar Jun 12 '23 17:06 olliestanley

Just realised this will need review from Andreas/Yannic also as it touches the docker/ directory. Hopefully one of them will be able to review soon

olliestanley avatar Jun 13 '23 07:06 olliestanley

@wirthual Sorry technical issues again. The code looks perfect. I had problems creating new sessions for adding the messages. Why did you choose to use Polyfactory instead of just inserting them without it? I'm seeing its compatibility with pydantic as a benefit but I'm assuming doing without it would be the same?

revenge47 avatar Jul 10 '23 08:07 revenge47

Yes, you are right. It could also be filled with data stored in a Json file.

The reason I chose polyfactory it made is just easier to fill the database with fake data. Plus if additional fields are added in future, it should just work out of the box.

wirthual avatar Jul 17 '23 19:07 wirthual