Open-Assistant
Open-Assistant copied to clipboard
Add functionality for fake data in inference server db
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.
: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
: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
@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.
Sorry for slow review on this - I think this is looking good, have just left a couple of comments
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
@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?
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.