Spaces:
Running
Running
Update app.py to read json from TreeOfLife-200M
Browse files
app.py
CHANGED
|
@@ -32,8 +32,6 @@ model_str = "hf-hub:imageomics/bioclip-2"
|
|
| 32 |
tokenizer_str = "ViT-L-14"
|
| 33 |
HF_DATA_STR = "imageomics/TreeOfLife-200M"
|
| 34 |
|
| 35 |
-
txt_names_json = "components/txt_emb_species.json"
|
| 36 |
-
|
| 37 |
min_prob = 1e-9
|
| 38 |
k = 5
|
| 39 |
|
|
@@ -203,7 +201,11 @@ if __name__ == "__main__":
|
|
| 203 |
filename="embeddings/txt_emb_species.npy",
|
| 204 |
repo_type="dataset",
|
| 205 |
)))
|
| 206 |
-
with open(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
txt_names = json.load(fd)
|
| 208 |
|
| 209 |
done = txt_emb.any(axis=0).sum().item()
|
|
|
|
| 32 |
tokenizer_str = "ViT-L-14"
|
| 33 |
HF_DATA_STR = "imageomics/TreeOfLife-200M"
|
| 34 |
|
|
|
|
|
|
|
| 35 |
min_prob = 1e-9
|
| 36 |
k = 5
|
| 37 |
|
|
|
|
| 201 |
filename="embeddings/txt_emb_species.npy",
|
| 202 |
repo_type="dataset",
|
| 203 |
)))
|
| 204 |
+
with open(hf_hub_download(
|
| 205 |
+
repo_id=HF_DATA_STR,
|
| 206 |
+
filename="embeddings/txt_emb_species.json",
|
| 207 |
+
repo_type="dataset",
|
| 208 |
+
)) as fd:
|
| 209 |
txt_names = json.load(fd)
|
| 210 |
|
| 211 |
done = txt_emb.any(axis=0).sum().item()
|