File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838 continue
3939
4040 # Otherwise generate
41- result = client .predict (
42- pdf_input = [handle_file (pdf_path ) for pdf_path in pdf_paths ],
43- api_name = "/generate_dome" ,
44- )
45-
46- # Rename the JSON file download by the Gradio client
47- tmp_path = result [- 1 ]
48- Path (tmp_path ).rename (json_path )
49- print (f"[{ i } /{ len (subfolders )} ] 🟢 Generated { subfolder .name } " )
41+ try :
42+ result = client .predict (
43+ pdf_input = [handle_file (pdf_path ) for pdf_path in pdf_paths ],
44+ api_name = "/generate_dome" ,
45+ )
46+
47+ # Rename the JSON file download by the Gradio client
48+ tmp_path = result [- 1 ]
49+ Path (tmp_path ).rename (json_path )
50+ print (f"[{ i } /{ len (subfolders )} ] 🟢 Generated { subfolder .name } " )
51+ except Exception :
52+ print (f"[{ i } /{ len (subfolders )} ] 🔴 Failed to generate { subfolder .name } " )
You can’t perform that action at this time.
0 commit comments