Spaces:
Sleeping
Sleeping
made a tool that downloads paper from arxiv
Browse files- mixtral_agent.py +1 -19
mixtral_agent.py
CHANGED
@@ -112,32 +112,14 @@ def get_arxiv_paper(paper_id:str) -> None:
|
|
112 |
"2312.02813". In addition please download one paper at a time. Pleaase keep the inputs/output
|
113 |
free of additional information only have the id.
|
114 |
"""
|
115 |
-
|
116 |
paper = next(arxiv.Client().results(arxiv.Search(id_list=[paper_id])))
|
117 |
|
118 |
number_without_period = paper_id.replace('.', '')
|
119 |
|
120 |
-
|
121 |
-
# Download the archive to the PWD with a default filename.
|
122 |
-
# paper.download_source()
|
123 |
-
# Download the archive to the PWD with a custom filename.
|
124 |
-
# paper.download_source(filename="downloaded-paper.tar.gz")
|
125 |
-
# Download the archive to a specified directory with a custom filename.
|
126 |
-
# paper.download_pdf(filename="downloaded-paper.pdf")
|
127 |
# Download the PDF to a specified directory with a custom filename.
|
128 |
paper.download_pdf(dirpath="./mydir", filename=f"{number_without_period}.pdf")
|
129 |
|
130 |
-
# file_name = number_without_period + ".tar.gz"
|
131 |
-
# dir_path = "./mydir"
|
132 |
-
# paper.download_source(dirpath=dir_path, filename=file_name)
|
133 |
-
|
134 |
-
# complete_path = dir_path + "/" + file_name
|
135 |
-
|
136 |
-
# unzip_file(complete_path,number_without_period)
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
|
142 |
tools = [
|
143 |
arxiv_search,
|
|
|
112 |
"2312.02813". In addition please download one paper at a time. Pleaase keep the inputs/output
|
113 |
free of additional information only have the id.
|
114 |
"""
|
115 |
+
# code from https://lukasschwab.me/arxiv.py/arxiv.html
|
116 |
paper = next(arxiv.Client().results(arxiv.Search(id_list=[paper_id])))
|
117 |
|
118 |
number_without_period = paper_id.replace('.', '')
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
# Download the PDF to a specified directory with a custom filename.
|
121 |
paper.download_pdf(dirpath="./mydir", filename=f"{number_without_period}.pdf")
|
122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
|
124 |
tools = [
|
125 |
arxiv_search,
|