Files changed (1) hide show
  1. README.md +15 -0
README.md CHANGED
@@ -318,6 +318,21 @@ urlretrieve(table_url, 'metadata.parquet')
318
  # Read the table using Pandas
319
  metadata_df = pd.read_parquet('metadata.parquet')
320
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
 
322
  ## Dataset Creation
323
 
 
318
  # Read the table using Pandas
319
  metadata_df = pd.read_parquet('metadata.parquet')
320
  ```
321
+ ### Method 4.
322
+
323
+ This method works fine:
324
+ ```python
325
+ from huggingface_hub import hf_hub_download
326
+ import pandas as pd
327
+
328
+ REPO_ID = "poloclub/diffusiondb" # dataset repo
329
+ FILENAME = "images/part-000001.zip" #first subset of dataset
330
+
331
+ hf_hub_download(repo_id=REPO_ID, filename=FILENAME, repo_type="dataset", local_dir=local_path)
332
+
333
+ # then you will need the json file which will be located in local_path/part-000001.json
334
+ metadata = pd.read_json("local_path/part-000001.json")
335
+ ```
336
 
337
  ## Dataset Creation
338