neindochoh commited on
Commit
db8c0d3
1 Parent(s): 8544358

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. run.py +7 -1
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Spotlight cifar10[train[:10]]
3
  emoji: 🔬
4
  colorFrom: indigo
5
  colorTo: green
 
1
  ---
2
+ title: Spotlight cifar10[train[:20]]
3
  emoji: 🔬
4
  colorFrom: indigo
5
  colorTo: green
run.py CHANGED
@@ -85,6 +85,12 @@ if __name__ == "__main__":
85
  f"mismatches length of the original dataset ({len(ds)})"
86
  )
87
  ds = datasets.concatenate_datasets([ds, ds_enrichment], split=ds.split, axis=1)
 
 
 
 
 
 
88
  if not isinstance(ds, datasets.Dataset):
89
  raise TypeError(
90
  f"Loaded Hugging Face dataset is of type {type(ds)} instead of "
@@ -92,4 +98,4 @@ if __name__ == "__main__":
92
  "(use environment variables `HF_SUBSET` and `HF_SPLIT` respective)?"
93
  )
94
  print(f"Serving Hugging Face dataset {hf_settings}.")
95
- spotlight.show(ds, host="0.0.0.0", port=7860, wait="forever")
 
85
  f"mismatches length of the original dataset ({len(ds)})"
86
  )
87
  ds = datasets.concatenate_datasets([ds, ds_enrichment], split=ds.split, axis=1)
88
+
89
+ dtypes = {}
90
+ for col in ds.column_names:
91
+ if "embedding" in col and isinstance(ds.features[col], datasets.Sequence):
92
+ dtypes[col] = spotlight.dtypes.embedding_dtype
93
+
94
  if not isinstance(ds, datasets.Dataset):
95
  raise TypeError(
96
  f"Loaded Hugging Face dataset is of type {type(ds)} instead of "
 
98
  "(use environment variables `HF_SUBSET` and `HF_SPLIT` respective)?"
99
  )
100
  print(f"Serving Hugging Face dataset {hf_settings}.")
101
+ spotlight.show(ds, host="0.0.0.0", port=7860, wait="forever", dtype=dtypes, analyze=True)