Spaces:
Runtime error
Runtime error
sc_ma
commited on
Commit
·
d1feb02
1
Parent(s):
2c0ffed
Fix error.
Browse files- auto_backgrounds.py +4 -1
auto_backgrounds.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
| 1 |
from utils.references import References
|
| 2 |
from utils.file_operations import hash_name, make_archive, copy_templates
|
| 3 |
from section_generator import section_generation_bg, keywords_generation, figures_generation, section_generation
|
|
@@ -37,7 +39,7 @@ def _generation_setup(title, description="", template="ICLR2022", model="gpt-4")
|
|
| 37 |
|
| 38 |
# Create a copy in the outputs folder.
|
| 39 |
bibtex_path, destination_folder = copy_templates(template, title)
|
| 40 |
-
logging.basicConfig(level=logging.INFO, filename=destination_folder
|
| 41 |
|
| 42 |
# Generate keywords and references
|
| 43 |
print("Initialize the paper information ...")
|
|
@@ -106,6 +108,7 @@ def generate_draft(title, description="", template="ICLR2022", model="gpt-4"):
|
|
| 106 |
print(message)
|
| 107 |
logging.info(message)
|
| 108 |
max_attempts = 2
|
|
|
|
| 109 |
# re-try `max_attempts` time
|
| 110 |
for i in range(max_attempts):
|
| 111 |
time.sleep(20)
|
|
|
|
| 1 |
+
import os.path
|
| 2 |
+
|
| 3 |
from utils.references import References
|
| 4 |
from utils.file_operations import hash_name, make_archive, copy_templates
|
| 5 |
from section_generator import section_generation_bg, keywords_generation, figures_generation, section_generation
|
|
|
|
| 39 |
|
| 40 |
# Create a copy in the outputs folder.
|
| 41 |
bibtex_path, destination_folder = copy_templates(template, title)
|
| 42 |
+
logging.basicConfig(level=logging.INFO, filename=os.path.join(destination_folder, "generation.log") )
|
| 43 |
|
| 44 |
# Generate keywords and references
|
| 45 |
print("Initialize the paper information ...")
|
|
|
|
| 108 |
print(message)
|
| 109 |
logging.info(message)
|
| 110 |
max_attempts = 2
|
| 111 |
+
# todo: make this part more compact
|
| 112 |
# re-try `max_attempts` time
|
| 113 |
for i in range(max_attempts):
|
| 114 |
time.sleep(20)
|