Added citation
Browse files
README.md
CHANGED
|
@@ -1,10 +1,35 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Hugging Face Dataset Exporter
|
| 2 |
+
|
| 3 |
+
This script exports data from a Postgres database to a Hugging Face dataset in Parquet format.
|
| 4 |
+
|
| 5 |
+
## Setup
|
| 6 |
+
|
| 7 |
+
1. **Install dependencies:**
|
| 8 |
+
|
| 9 |
+
Navigate to this directory and install the required Python packages.
|
| 10 |
+
|
| 11 |
+
```bash
|
| 12 |
+
pip install -r requirements.txt
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
2. **Set environment variables:**
|
| 16 |
+
|
| 17 |
+
The script uses environment variables for database credentials. You can set them in your shell or use a `.env` file.
|
| 18 |
+
|
| 19 |
+
```bash
|
| 20 |
+
export DB_USER="your_db_user"
|
| 21 |
+
export DB_PASSWORD="your_db_password"
|
| 22 |
+
export DB_HOST="localhost"
|
| 23 |
+
export DB_PORT="5432"
|
| 24 |
+
export DB_NAME="your_db_name"
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
## Usage
|
| 28 |
+
|
| 29 |
+
Run the script from the root of the repository:
|
| 30 |
+
|
| 31 |
+
```bash
|
| 32 |
+
python scripts/hf_export/export.py --output_dir /path/to/your/dataset
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
The script will create a directory at the specified output path containing the dataset in Parquet format. If `--output_dir` is not provided, it will save to `hf_dataset` in the current working directory.
|