shaocongma commited on
Commit
3afc671
1 Parent(s): 3a7ead9

add new engine

Browse files
.idea/.gitignore ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Datasource local storage ignored files
5
+ /dataSources/
6
+ /dataSources.local.xml
7
+ # Editor-based HTTP Client requests
8
+ /httpRequests/
.idea/auto-draft.iml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="PYTHON_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/venv" />
6
+ </content>
7
+ <orderEntry type="inheritedJdk" />
8
+ <orderEntry type="sourceFolder" forTests="false" />
9
+ </component>
10
+ <component name="PyDocumentationSettings">
11
+ <option name="format" value="PLAIN" />
12
+ <option name="myDocStringFormat" value="Plain" />
13
+ </component>
14
+ </module>
.idea/inspectionProfiles/Project_Default.xml ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="PyChainedComparisonsInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
5
+ <option name="ignoreConstantInTheMiddle" value="true" />
6
+ </inspection_tool>
7
+ <inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
8
+ <option name="ignoredPackages">
9
+ <value>
10
+ <list size="69">
11
+ <item index="0" class="java.lang.String" itemvalue="pprint" />
12
+ <item index="1" class="java.lang.String" itemvalue="tnt" />
13
+ <item index="2" class="java.lang.String" itemvalue="pyglet" />
14
+ <item index="3" class="java.lang.String" itemvalue="pyzmq" />
15
+ <item index="4" class="java.lang.String" itemvalue="gym" />
16
+ <item index="5" class="java.lang.String" itemvalue="torch" />
17
+ <item index="6" class="java.lang.String" itemvalue="numpy" />
18
+ <item index="7" class="java.lang.String" itemvalue="absl-py" />
19
+ <item index="8" class="java.lang.String" itemvalue="numba" />
20
+ <item index="9" class="java.lang.String" itemvalue="protobuf" />
21
+ <item index="10" class="java.lang.String" itemvalue="torch-scatter" />
22
+ <item index="11" class="java.lang.String" itemvalue="joblib" />
23
+ <item index="12" class="java.lang.String" itemvalue="threadpoolctl" />
24
+ <item index="13" class="java.lang.String" itemvalue="scikit-learn" />
25
+ <item index="14" class="java.lang.String" itemvalue="PyYAML" />
26
+ <item index="15" class="java.lang.String" itemvalue="python-dateutil" />
27
+ <item index="16" class="java.lang.String" itemvalue="cycler" />
28
+ <item index="17" class="java.lang.String" itemvalue="MarkupSafe" />
29
+ <item index="18" class="java.lang.String" itemvalue="mpi4py" />
30
+ <item index="19" class="java.lang.String" itemvalue="torchvision" />
31
+ <item index="20" class="java.lang.String" itemvalue="line-profiler" />
32
+ <item index="21" class="java.lang.String" itemvalue="pyasn1-modules" />
33
+ <item index="22" class="java.lang.String" itemvalue="certifi" />
34
+ <item index="23" class="java.lang.String" itemvalue="oauthlib" />
35
+ <item index="24" class="java.lang.String" itemvalue="pyparsing" />
36
+ <item index="25" class="java.lang.String" itemvalue="Markdown" />
37
+ <item index="26" class="java.lang.String" itemvalue="Werkzeug" />
38
+ <item index="27" class="java.lang.String" itemvalue="h5py" />
39
+ <item index="28" class="java.lang.String" itemvalue="rdflib" />
40
+ <item index="29" class="java.lang.String" itemvalue="torch-cluster" />
41
+ <item index="30" class="java.lang.String" itemvalue="kiwisolver" />
42
+ <item index="31" class="java.lang.String" itemvalue="pytorch-lightning" />
43
+ <item index="32" class="java.lang.String" itemvalue="tensorboard" />
44
+ <item index="33" class="java.lang.String" itemvalue="imageio" />
45
+ <item index="34" class="java.lang.String" itemvalue="matplotlib" />
46
+ <item index="35" class="java.lang.String" itemvalue="test-tube" />
47
+ <item index="36" class="java.lang.String" itemvalue="googledrivedownloader" />
48
+ <item index="37" class="java.lang.String" itemvalue="idna" />
49
+ <item index="38" class="java.lang.String" itemvalue="rsa" />
50
+ <item index="39" class="java.lang.String" itemvalue="networkx" />
51
+ <item index="40" class="java.lang.String" itemvalue="isodate" />
52
+ <item index="41" class="java.lang.String" itemvalue="torch-sparse" />
53
+ <item index="42" class="java.lang.String" itemvalue="llvmlite" />
54
+ <item index="43" class="java.lang.String" itemvalue="pyasn1" />
55
+ <item index="44" class="java.lang.String" itemvalue="requests" />
56
+ <item index="45" class="java.lang.String" itemvalue="importlib-metadata" />
57
+ <item index="46" class="java.lang.String" itemvalue="Jinja2" />
58
+ <item index="47" class="java.lang.String" itemvalue="requests-oauthlib" />
59
+ <item index="48" class="java.lang.String" itemvalue="tensorboard-plugin-wit" />
60
+ <item index="49" class="java.lang.String" itemvalue="zipp" />
61
+ <item index="50" class="java.lang.String" itemvalue="urllib3" />
62
+ <item index="51" class="java.lang.String" itemvalue="torch-geometric" />
63
+ <item index="52" class="java.lang.String" itemvalue="scipy" />
64
+ <item index="53" class="java.lang.String" itemvalue="six" />
65
+ <item index="54" class="java.lang.String" itemvalue="google-auth-oauthlib" />
66
+ <item index="55" class="java.lang.String" itemvalue="chardet" />
67
+ <item index="56" class="java.lang.String" itemvalue="pandas" />
68
+ <item index="57" class="java.lang.String" itemvalue="tqdm" />
69
+ <item index="58" class="java.lang.String" itemvalue="torch-spline-conv" />
70
+ <item index="59" class="java.lang.String" itemvalue="ase" />
71
+ <item index="60" class="java.lang.String" itemvalue="future" />
72
+ <item index="61" class="java.lang.String" itemvalue="cachetools" />
73
+ <item index="62" class="java.lang.String" itemvalue="grpcio" />
74
+ <item index="63" class="java.lang.String" itemvalue="pytz" />
75
+ <item index="64" class="java.lang.String" itemvalue="google-auth" />
76
+ <item index="65" class="java.lang.String" itemvalue="Pillow" />
77
+ <item index="66" class="java.lang.String" itemvalue="decorator" />
78
+ <item index="67" class="java.lang.String" itemvalue="typing-extensions" />
79
+ <item index="68" class="java.lang.String" itemvalue="ale-py" />
80
+ </list>
81
+ </value>
82
+ </option>
83
+ </inspection_tool>
84
+ <inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
85
+ <option name="ignoredErrors">
86
+ <list>
87
+ <option value="N812" />
88
+ <option value="N802" />
89
+ <option value="N803" />
90
+ <option value="N806" />
91
+ </list>
92
+ </option>
93
+ </inspection_tool>
94
+ </profile>
95
+ </component>
.idea/inspectionProfiles/profiles_settings.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="USE_PROJECT_PROFILE" value="false" />
4
+ <version value="1.0" />
5
+ </settings>
6
+ </component>
.idea/misc.xml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (auto-draft)" project-jdk-type="Python SDK" />
4
+ </project>
.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/auto-draft.iml" filepath="$PROJECT_DIR$/.idea/auto-draft.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
__pycache__/auto_backgrounds.cpython-310.pyc ADDED
Binary file (4.06 kB). View file
 
__pycache__/auto_draft.cpython-310.pyc ADDED
Binary file (4.56 kB). View file
 
__pycache__/section_generator.cpython-310.pyc ADDED
Binary file (2.42 kB). View file
 
app.py CHANGED
@@ -11,10 +11,13 @@ from utils.file_operations import hash_name
11
  # 5.1 Use GPT 3.5 for abstract, conclusion, ... (or may not)
12
  # 5.2 Use local LLM to generate keywords, figures, ...
13
  # 5.3 Use embedding to find most related papers (find a paper dataset)
14
- # 5.4 Use Semantic Scholar API instead of Arxiv API.
15
  # 6. get logs when the procedure is not completed.
16
  # 7. 自己的文件库; 更多的prompts
17
  # 8. Change prompts to langchain
 
 
 
 
18
 
19
  openai_key = os.getenv("OPENAI_API_KEY")
20
  access_key_id = os.getenv('AWS_ACCESS_KEY_ID')
 
11
  # 5.1 Use GPT 3.5 for abstract, conclusion, ... (or may not)
12
  # 5.2 Use local LLM to generate keywords, figures, ...
13
  # 5.3 Use embedding to find most related papers (find a paper dataset)
 
14
  # 6. get logs when the procedure is not completed.
15
  # 7. 自己的文件库; 更多的prompts
16
  # 8. Change prompts to langchain
17
+ # 9. some references include &: journal={IEEE Power & Energy Society General Meeting}. Check them when generating it.
18
+ # 10. some paper ids have : or - in the first word of title; remove them when generating paper id.
19
+ # 11. distinguish citep and citet
20
+ # 12. Change link to more appealing color
21
 
22
  openai_key = os.getenv("OPENAI_API_KEY")
23
  access_key_id = os.getenv('AWS_ACCESS_KEY_ID')
auto_backgrounds.py CHANGED
@@ -91,7 +91,7 @@ def fake_generator(title, description="", template="ICLR2022", model="gpt-4"):
91
  return make_archive("sample-output.pdf", filename)
92
 
93
 
94
- def generate_draft(title, description="", template="ICLR2022", model="gpt-4", search_engine="ss", tldr=False, max_kw_refs=5):
95
  paper, destination_folder, _ = _generation_setup(title, description, template, model, search_engine, tldr, max_kw_refs)
96
 
97
  # todo: `list_of_methods` failed to be generated; find a solution ...
 
91
  return make_archive("sample-output.pdf", filename)
92
 
93
 
94
+ def generate_draft(title, description="", template="ICLR2022", model="gpt-4", search_engine="ss", tldr=True, max_kw_refs=12):
95
  paper, destination_folder, _ = _generation_setup(title, description, template, model, search_engine, tldr, max_kw_refs)
96
 
97
  # todo: `list_of_methods` failed to be generated; find a solution ...
utils/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (137 Bytes). View file
 
utils/__pycache__/figures.cpython-310.pyc ADDED
Binary file (1.89 kB). View file
 
utils/__pycache__/file_operations.cpython-310.pyc ADDED
Binary file (1.41 kB). View file
 
utils/__pycache__/gpt_interaction.cpython-310.pyc ADDED
Binary file (2.79 kB). View file
 
utils/__pycache__/prompts.cpython-310.pyc ADDED
Binary file (6.66 kB). View file
 
utils/__pycache__/references.cpython-310.pyc ADDED
Binary file (6.77 kB). View file
 
utils/__pycache__/storage.cpython-310.pyc ADDED
Binary file (1.71 kB). View file
 
utils/__pycache__/tex_processing.cpython-310.pyc ADDED
Binary file (609 Bytes). View file