rohitnain/AI_Powered_Test_Data_Generator
0
AI-Powered Test Data Generator
Generate realistic test data for testing, development, and prototyping using open-source LLMs via HuggingFace Inference API.
Features
- Generate structured data (users, products, orders, employees, transactions, reviews)
- Custom schema support with JSON definitions
- Multiple export formats (CSV, JSON)
- Uses HuggingFace Inference API with open-source models
- Batch generation (up to 100 records)
- Multiple locale support
- Deployable on HuggingFace Spaces
Available Models
meta-llama/Meta-Llama-3.1-8B-InstructQwen/Qwen2.5-72B-Instructgoogle/gemma-2-9b-it
Setup
Local Installation
- Clone the repository:
git clone https://github.com/yourusername/test-data-generator.git
cd test-data-generator- Install dependencies:
pip install -r requirements.txt- Set your HuggingFace token:
export HF_TOKEN=your_token_here- Run the app:
python app.pyHuggingFace Spaces Deployment
- Create a new Space at huggingface.co/spaces
- Select "Gradio" as the SDK
- Upload
app.pyandrequirements.txt - Add
HF_TOKENas a Space secret (Settings > Repository secrets)
Usage
Template Generator
- Select an LLM model from the dropdown
- Choose a data type template (Users, Products, Orders, etc.)
- Customize fields if needed
- Set the number of records to generate
- Add custom instructions (optional)
- Click "Generate Data"
- Download as CSV or JSON
Custom Schema
Define your own schema as a JSON object where:
- Each key is a field name
- Each value describes what data to generate
Example:
{
"id": "unique integer identifier",
"company_name": "realistic company name",
"industry": "industry sector",
"revenue": "annual revenue in millions USD",
"employees": "number of employees",
"founded_year": "year company was founded"
}Environment Variables
Get your free token at: https://huggingface.co/settings/tokens
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
