robocan commited on
Commit
db673be
·
verified ·
1 Parent(s): 1cafe56

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -1,15 +1,16 @@
1
  import os
2
- import subprocess
3
 
4
  # Retrieve the token from the environment variables
5
  token = os.environ.get("token")
6
 
7
- # Clone the repository using the token
8
- repo_url = f"https://robocan:{token}@huggingface.co/robocan/GeoG_City"
9
- destination_dir = os.path.expanduser("~/SVD") # Use a directory in the home directory
10
-
11
- # Run the git clone command using subprocess
12
- subprocess.run(["git", "clone", repo_url, destination_dir], check=True)
 
13
 
14
  import torch
15
  from torch.utils.data import Dataset, DataLoader
 
1
  import os
2
+ from huggingface_hub import Repository
3
 
4
  # Retrieve the token from the environment variables
5
  token = os.environ.get("token")
6
 
7
+ repo = Repository(
8
+ local_dir="SVD",
9
+ repo_type="model",
10
+ clone_from="robocan/GeoG_City",
11
+ token=token
12
+ )
13
+ repo.git_pull()
14
 
15
  import torch
16
  from torch.utils.data import Dataset, DataLoader