File tree 1 file changed +11
-4
lines changed
misc/scripts/models-as-data 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -441,11 +441,18 @@ def main(config, args) -> None:
441
441
if experiment_name is None :
442
442
print ("ERROR: --dca argument is required for DCA strategy" )
443
443
sys .exit (1 )
444
- pat = args . pat
445
- if pat is None :
444
+
445
+ if args . pat is None :
446
446
print ("ERROR: --pat argument is required for DCA strategy" )
447
447
sys .exit (1 )
448
- database_results = download_dca_databases (experiment_name , pat , projects )
448
+ if not os .path .exists (args .pat ):
449
+ print (f"ERROR: Personal Access Token file '{ pat } ' does not exist." )
450
+ sys .exit (1 )
451
+ with open (args .pat , "r" ) as f :
452
+ pat = f .read ().strip ()
453
+ database_results = download_dca_databases (
454
+ experiment_name , pat , projects
455
+ )
449
456
450
457
# Generate models for all projects
451
458
print ("\n === Generating models ===" )
@@ -485,7 +492,7 @@ def main(config, args) -> None:
485
492
parser .add_argument (
486
493
"--pat" ,
487
494
type = str ,
488
- help = "PAT token to grab DCA databases (the same as the one you use for DCA)" ,
495
+ help = "Path to a file containing the PAT token required to grab DCA databases (the same as the one you use for DCA)" ,
489
496
required = False ,
490
497
)
491
498
args = parser .parse_args ()
You can’t perform that action at this time.
0 commit comments