Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Llama Index
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
run-llama
Llama Index
Commits
adb4c9b4
Unverified
Commit
adb4c9b4
authored
11 months ago
by
Christophe Bornet
Committed by
GitHub
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix download_llama_dataset and download_llama_pack (#12273)
parent
f6ed4a67
Branches
master
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
llama-index-core/llama_index/core/download/utils.py
+4
-2
4 additions, 2 deletions
llama-index-core/llama_index/core/download/utils.py
llama-index-legacy/llama_index/legacy/download/dataset.py
+3
-1
3 additions, 1 deletion
llama-index-legacy/llama_index/legacy/download/dataset.py
with
7 additions
and
3 deletions
llama-index-core/llama_index/core/download/utils.py
+
4
−
2
View file @
adb4c9b4
...
@@ -90,7 +90,9 @@ def initialize_directory(
...
@@ -90,7 +90,9 @@ def initialize_directory(
def
get_source_files_list
(
source_tree_url
:
str
,
path
:
str
)
->
List
[
str
]:
def
get_source_files_list
(
source_tree_url
:
str
,
path
:
str
)
->
List
[
str
]:
"""
Get the list of source files to download.
"""
"""
Get the list of source files to download.
"""
resp
=
requests
.
get
(
source_tree_url
+
path
+
"
?recursive=1
"
)
resp
=
requests
.
get
(
source_tree_url
+
path
+
"
?recursive=1
"
,
headers
=
{
"
Accept
"
:
"
application/json
"
}
)
payload
=
resp
.
json
()[
"
payload
"
]
payload
=
resp
.
json
()[
"
payload
"
]
return
[
item
[
"
name
"
]
for
item
in
payload
[
"
tree
"
][
"
items
"
]]
return
[
item
[
"
name
"
]
for
item
in
payload
[
"
tree
"
][
"
items
"
]]
...
@@ -105,7 +107,7 @@ def recursive_tree_traverse(
...
@@ -105,7 +107,7 @@ def recursive_tree_traverse(
url
=
tree_urls
[
0
]
url
=
tree_urls
[
0
]
try
:
try
:
res
=
requests
.
get
(
url
)
res
=
requests
.
get
(
url
,
headers
=
{
"
Accept
"
:
"
application/json
"
}
)
tree_elements
=
res
.
json
()[
"
payload
"
][
"
tree
"
][
"
items
"
]
tree_elements
=
res
.
json
()[
"
payload
"
][
"
tree
"
][
"
items
"
]
except
Exception
:
except
Exception
:
raise
ValueError
(
"
Failed to traverse github tree source.
"
)
raise
ValueError
(
"
Failed to traverse github tree source.
"
)
...
...
This diff is collapsed.
Click to expand it.
llama-index-legacy/llama_index/legacy/download/dataset.py
+
3
−
1
View file @
adb4c9b4
...
@@ -47,7 +47,9 @@ def _resolve_dataset_file_name(class_name: str) -> str:
...
@@ -47,7 +47,9 @@ def _resolve_dataset_file_name(class_name: str) -> str:
def
_get_source_files_list
(
source_tree_url
:
str
,
path
:
str
)
->
List
[
str
]:
def
_get_source_files_list
(
source_tree_url
:
str
,
path
:
str
)
->
List
[
str
]:
"""
Get the list of source files to download.
"""
"""
Get the list of source files to download.
"""
resp
=
requests
.
get
(
source_tree_url
+
path
+
"
?recursive=1
"
)
resp
=
requests
.
get
(
source_tree_url
+
path
+
"
?recursive=1
"
,
headers
=
{
"
Accept
"
:
"
application/json
"
}
)
payload
=
resp
.
json
()[
"
payload
"
]
payload
=
resp
.
json
()[
"
payload
"
]
return
[
item
[
"
name
"
]
for
item
in
payload
[
"
tree
"
][
"
items
"
]]
return
[
item
[
"
name
"
]
for
item
in
payload
[
"
tree
"
][
"
items
"
]]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment