Updating ReadMe
Browse files
README.md
CHANGED
|
@@ -72,60 +72,12 @@ Step 2 : Create the *npz.tar.gz files
|
|
| 72 |
|
| 73 |
Refer to the directory structure section below to understand how these files have been staged inside huggingface.
|
| 74 |
|
| 75 |
-
**Data Preparation**
|
| 76 |
-
|
| 77 |
-
Please refer to our [github](https://github.com/baskargroup/mpfbench-tools/tree/master/DataPrep) page that provides codes for doing data preparation for SciML models:
|
| 78 |
-
|
| 79 |
-
```
|
| 80 |
-
https://github.com/baskargroup/mpfbench-tools/tree/master/DataPrep
|
| 81 |
-
```
|
| 82 |
-
|
| 83 |
**License**
|
| 84 |
```
|
| 85 |
CC-BY-NC-SA-4.0
|
| 86 |
```
|
| 87 |
|
| 88 |
-
**
|
| 89 |
-
|
| 90 |
-
To run the example code, you need to install the following package:
|
| 91 |
-
|
| 92 |
-
```bash
|
| 93 |
-
pip install huggingface_hub
|
| 94 |
-
```
|
| 95 |
-
|
| 96 |
-
The following script demonstrates how to download a directory from the Hugging Face Hub:
|
| 97 |
-
|
| 98 |
-
```python
|
| 99 |
-
from huggingface_hub import HfApi, hf_hub_download
|
| 100 |
-
import os
|
| 101 |
-
import shutil
|
| 102 |
-
|
| 103 |
-
REPO_ID = "BGLab/mpf-bench"
|
| 104 |
-
DIRECTORY = "2Dbubble/bubbleGroup1_npz"
|
| 105 |
-
|
| 106 |
-
# Initialize the Hugging Face API
|
| 107 |
-
api = HfApi()
|
| 108 |
-
|
| 109 |
-
# List files in the directory
|
| 110 |
-
files_list = api.list_repo_files(repo_id=REPO_ID, repo_type="dataset")
|
| 111 |
-
|
| 112 |
-
# Filter the files in the specified directory
|
| 113 |
-
files_to_download = [f for f in files_list if f.startswith(DIRECTORY)]
|
| 114 |
-
|
| 115 |
-
# Create local directory if it doesn't exist
|
| 116 |
-
os.makedirs(DIRECTORY, exist_ok=True)
|
| 117 |
-
|
| 118 |
-
# Download each file
|
| 119 |
-
for file in files_to_download:
|
| 120 |
-
file_path = hf_hub_download(repo_id=REPO_ID, filename=file, repo_type="dataset")
|
| 121 |
-
# Copy the file to the local directory using shutil.copy2
|
| 122 |
-
shutil.copy2(file_path, os.path.join(DIRECTORY, os.path.basename(file_path)))
|
| 123 |
-
|
| 124 |
-
print("Files downloaded successfully.")
|
| 125 |
-
|
| 126 |
-
```
|
| 127 |
-
|
| 128 |
-
**Directory Structure**
|
| 129 |
```
|
| 130 |
main/
|
| 131 |
├── 2Dbubble/
|
|
|
|
| 72 |
|
| 73 |
Refer to the directory structure section below to understand how these files have been staged inside huggingface.
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
**License**
|
| 76 |
```
|
| 77 |
CC-BY-NC-SA-4.0
|
| 78 |
```
|
| 79 |
|
| 80 |
+
**Directory Structure of the data**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
```
|
| 82 |
main/
|
| 83 |
├── 2Dbubble/
|