cyberosa commited on
Commit
92efc51
1 Parent(s): ac62b55

formatting files

Browse files
Files changed (1) hide show
  1. start.py +18 -6
start.py CHANGED
@@ -6,7 +6,9 @@ from huggingface_hub import hf_hub_download
6
 
7
  def run_command(command: str, cwd: str = None) -> tuple:
8
  """Run a shell command in the specified directory and return the output."""
9
- process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
 
 
10
  stdout, stderr = process.communicate()
11
  if process.returncode != 0:
12
  print(f"Error: {stderr.decode()}")
@@ -17,10 +19,12 @@ def run_command(command: str, cwd: str = None) -> tuple:
17
 
18
  def download_dataset():
19
  """Download the dataset."""
20
- print("Downloading the dataset...")
21
  repo_id = "valory/autocast"
22
  base_dir = os.getcwd()
23
- output_dir = os.path.join(base_dir, "olas-predict-benchmark", "benchmark", "data", "autocast")
 
 
24
  if not os.path.exists(output_dir):
25
  os.makedirs(output_dir, exist_ok=True)
26
  filenames = [
@@ -28,7 +32,12 @@ def download_dataset():
28
  "autocast_questions_filtered.pkl",
29
  ]
30
  for filename in filenames:
31
- hf_hub_download(repo_id=repo_id, filename=filename, local_dir=output_dir, repo_type="dataset")
 
 
 
 
 
32
  print("Dataset downloaded successfully.")
33
 
34
 
@@ -43,7 +52,10 @@ def start():
43
  ("git submodule init", base_dir),
44
  ("git submodule update --init --recursive", base_dir),
45
  ("git submodule update --remote --recursive", base_dir),
46
- ('git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"', olas_dir),
 
 
 
47
  ("git remote update", olas_dir),
48
  ("git fetch --all", olas_dir),
49
  ("git checkout main", olas_dir),
@@ -66,4 +78,4 @@ def start():
66
  download_dataset()
67
 
68
 
69
- start()
 
6
 
7
  def run_command(command: str, cwd: str = None) -> tuple:
8
  """Run a shell command in the specified directory and return the output."""
9
+ process = subprocess.Popen(
10
+ command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd
11
+ )
12
  stdout, stderr = process.communicate()
13
  if process.returncode != 0:
14
  print(f"Error: {stderr.decode()}")
 
19
 
20
  def download_dataset():
21
  """Download the dataset."""
22
+ print("Downloading the autocast dataset...")
23
  repo_id = "valory/autocast"
24
  base_dir = os.getcwd()
25
+ output_dir = os.path.join(
26
+ base_dir, "olas-predict-benchmark", "benchmark", "data", "autocast"
27
+ )
28
  if not os.path.exists(output_dir):
29
  os.makedirs(output_dir, exist_ok=True)
30
  filenames = [
 
32
  "autocast_questions_filtered.pkl",
33
  ]
34
  for filename in filenames:
35
+ hf_hub_download(
36
+ repo_id=repo_id,
37
+ filename=filename,
38
+ local_dir=output_dir,
39
+ repo_type="dataset",
40
+ )
41
  print("Dataset downloaded successfully.")
42
 
43
 
 
52
  ("git submodule init", base_dir),
53
  ("git submodule update --init --recursive", base_dir),
54
  ("git submodule update --remote --recursive", base_dir),
55
+ (
56
+ 'git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"',
57
+ olas_dir,
58
+ ),
59
  ("git remote update", olas_dir),
60
  ("git fetch --all", olas_dir),
61
  ("git checkout main", olas_dir),
 
78
  download_dataset()
79
 
80
 
81
+ start()