uripper commited on
Commit
f490dc1
·
1 Parent(s): 332c4c1

it needs to be able to see a function named main

Browse files
Files changed (1) hide show
  1. app/download_models.py +18 -5
app/download_models.py CHANGED
@@ -1,11 +1,12 @@
1
  import os
2
  from huggingface_hub import hf_hub_download
3
 
4
- # Get the Hugging Face token from environment variable (automatically provided from the secret)
5
- HUGGINGFACE_TOKEN = os.getenv("HF_TOKEN")
6
 
7
- if HUGGINGFACE_TOKEN is None:
8
- raise ValueError("Hugging Face token is missing. Please set the 'HF_TOKEN' environment variable.")
 
 
 
9
 
10
  def create_directory(dir_path):
11
  """
@@ -40,7 +41,15 @@ def download_model(repo_id, filename, destination_dir, token):
40
  return full_path
41
 
42
 
43
- if __name__ == "__main__":
 
 
 
 
 
 
 
 
44
  # Define the repositories and filenames
45
  magic_gnn_repo = "uripper/magic-gnn"
46
  oracle_cards_graph_repo = "uripper/oracle_cards_graph"
@@ -70,3 +79,7 @@ if __name__ == "__main__":
70
  print("\nDownload complete:")
71
  print(f"Card Graph: {card_graph_path}")
72
  print(f"Oracle Cards Graph: {oracle_cards_graph_path}")
 
 
 
 
 
1
  import os
2
  from huggingface_hub import hf_hub_download
3
 
 
 
4
 
5
+ # download_models.py
6
+
7
+ import os
8
+ from huggingface_hub import hf_hub_download
9
+
10
 
11
  def create_directory(dir_path):
12
  """
 
41
  return full_path
42
 
43
 
44
+ def main():
45
+ # Get the Hugging Face token from environment variable (automatically provided from the secret)
46
+ HUGGINGFACE_TOKEN = os.getenv("HF_TOKEN")
47
+
48
+ if HUGGINGFACE_TOKEN is None:
49
+ raise ValueError(
50
+ "Hugging Face token is missing. Please set the 'HF_TOKEN' environment variable."
51
+ )
52
+
53
  # Define the repositories and filenames
54
  magic_gnn_repo = "uripper/magic-gnn"
55
  oracle_cards_graph_repo = "uripper/oracle_cards_graph"
 
79
  print("\nDownload complete:")
80
  print(f"Card Graph: {card_graph_path}")
81
  print(f"Oracle Cards Graph: {oracle_cards_graph_path}")
82
+
83
+
84
+ if __name__ == "__main__":
85
+ main()