Chancee12 commited on
Commit
be1518e
·
1 Parent(s): f22bd91

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -18,12 +18,22 @@ from keras.models import load_model
18
  # Replace 'your_username' and 'your_model_name' with the appropriate values
19
  import zipfile
20
 
 
 
 
 
21
  model_identifier = "Chancee12/satellite_segmentation_v3_full"
22
  filename = "satellite_segmentation_v3_full.zip"
23
- model_directory = hf_hub_download(repo_id=model_identifier, filename=filename, repo_type="model")
 
 
 
 
 
 
24
 
25
  # Extract the zip file
26
- with zipfile.ZipFile(model_directory, 'r') as zip_ref:
27
  zip_ref.extractall("satellite_segmentation_v3_full")
28
 
29
 
 
18
  # Replace 'your_username' and 'your_model_name' with the appropriate values
19
  import zipfile
20
 
21
+ from huggingface_hub import HfApi, HfFolder
22
+ import requests
23
+
24
+ api = HfApi()
25
  model_identifier = "Chancee12/satellite_segmentation_v3_full"
26
  filename = "satellite_segmentation_v3_full.zip"
27
+
28
+ # Get the URL to download the model
29
+ url = api.model_download_url(model_identifier, filename)
30
+
31
+ # Download the model
32
+ response = requests.get(url)
33
+ open(filename, "wb").write(response.content)
34
 
35
  # Extract the zip file
36
+ with zipfile.ZipFile(filename, 'r') as zip_ref:
37
  zip_ref.extractall("satellite_segmentation_v3_full")
38
 
39