FridayCodehhr commited on
Commit
df0e7a4
·
verified ·
1 Parent(s): 4a76722

Upload script.py

Browse files
Files changed (1) hide show
  1. script.py +3 -4
script.py CHANGED
@@ -6,7 +6,6 @@ import tqdm
6
 
7
  BASE = Path(__file__).resolve().parents[0]
8
  DATASET_DIR = BASE / "dataset"
9
- GPT_DIR = BASE / "gpt"
10
 
11
 
12
  def find_split_dir() -> Path:
@@ -22,10 +21,10 @@ def run_for_pdf(pdf_path: Path, out_path: Path) -> int:
22
  out_path.parent.mkdir(parents=True, exist_ok=True)
23
 
24
  cmd = [sys.executable, "main.py", "--pdf", str(pdf_path), "--out", str(out_path)]
25
- print(f"Running: {' '.join(cmd)} (cwd={GPT_DIR})")
26
- proc = subprocess.run(cmd, cwd=str(GPT_DIR), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
27
  if proc.returncode != 0:
28
- print(f"ERROR: gpt/main.py failed for {pdf_path.name} (rc={proc.returncode})")
29
  print(proc.stdout)
30
  print(proc.stderr)
31
  else:
 
6
 
7
  BASE = Path(__file__).resolve().parents[0]
8
  DATASET_DIR = BASE / "dataset"
 
9
 
10
 
11
  def find_split_dir() -> Path:
 
21
  out_path.parent.mkdir(parents=True, exist_ok=True)
22
 
23
  cmd = [sys.executable, "main.py", "--pdf", str(pdf_path), "--out", str(out_path)]
24
+ print(f"Running: {' '.join(cmd)}")
25
+ proc = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
26
  if proc.returncode != 0:
27
+ print(f"ERROR: main.py failed for {pdf_path.name} (rc={proc.returncode})")
28
  print(proc.stdout)
29
  print(proc.stderr)
30
  else: