Paolo-Fraccaro
commited on
Commit
·
7bacd60
1
Parent(s):
1720306
add model def import
Browse files
app.py
CHANGED
@@ -1,3 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import argparse
|
2 |
import functools
|
3 |
import os
|
@@ -363,10 +371,8 @@ def predict_on_images(data_files: list, mask_ratio: float, yaml_file_path: str,
|
|
363 |
|
364 |
return outputs
|
365 |
|
366 |
-
from huggingface_hub import hf_hub_download
|
367 |
|
368 |
-
|
369 |
-
checkpoint=hf_hub_download(repo_id="ibm-nasa-geospatial/Prithvi-100M", filename='Prithvi_100M.pt')
|
370 |
|
371 |
func = partial(predict_on_images, yaml_file_path=yaml_file_path,checkpoint=checkpoint)
|
372 |
|
|
|
1 |
+
#### pull files from hub
|
2 |
+
from huggingface_hub import hf_hub_download
|
3 |
+
import os
|
4 |
+
yaml_file_path=hf_hub_download(repo_id="ibm-nasa-geospatial/Prithvi-100M", filename="Prithvi_100M_config.yaml")
|
5 |
+
checkpoint=hf_hub_download(repo_id="ibm-nasa-geospatial/Prithvi-100M", filename='Prithvi_100M.pt')
|
6 |
+
model_def=hf_hub_download(repo_id="ibm-nasa-geospatial/Prithvi-100M", filename='Prithvi.py')
|
7 |
+
os.system(f'cp {model_def} .')
|
8 |
+
#####
|
9 |
import argparse
|
10 |
import functools
|
11 |
import os
|
|
|
371 |
|
372 |
return outputs
|
373 |
|
|
|
374 |
|
375 |
+
|
|
|
376 |
|
377 |
func = partial(predict_on_images, yaml_file_path=yaml_file_path,checkpoint=checkpoint)
|
378 |
|