Skip to content
Snippets Groups Projects
Unverified Commit 65af1b65 authored by Logan's avatar Logan Committed by GitHub
Browse files

fix download loaders [v0.9.6.post2] (#9106)

parent cf053b98
No related branches found
No related tags found
No related merge requests found
0.9.6.post1
0.9.6.post2
......@@ -244,6 +244,7 @@ def download_llama_module(
base_file_name: str = "base.py",
use_gpt_index_import: bool = False,
disable_library_cache: bool = False,
override_path: bool = False,
) -> Type:
"""Download a module from LlamaHub.
......@@ -290,15 +291,24 @@ def download_llama_module(
refresh_cache=refresh_cache,
use_gpt_index_import=use_gpt_index_import,
base_file_name=base_file_name,
override_path=True,
override_path=override_path,
)
# loads the module into memory
spec = util.spec_from_file_location(
"custom_module", location=f"{dirpath}/{base_file_name}"
)
if spec is None:
raise ValueError(f"Could not find file: {dirpath}/{base_file_name}.")
if override_path:
spec = util.spec_from_file_location(
"custom_module", location=f"{dirpath}/{base_file_name}"
)
if spec is None:
raise ValueError(f"Could not find file: {dirpath}/{base_file_name}.")
else:
spec = util.spec_from_file_location(
"custom_module", location=f"{dirpath}/{module_id}/{base_file_name}"
)
if spec is None:
raise ValueError(
f"Could not find file: {dirpath}/{module_id}/{base_file_name}."
)
module = util.module_from_spec(spec)
spec.loader.exec_module(module) # type: ignore
......
......@@ -28,6 +28,7 @@ def download_llama_pack(
custom_path=download_dir,
library_path="llama_packs/library.json",
disable_library_cache=True,
override_path=True,
)
if not issubclass(pack_cls, BaseLlamaPack):
raise ValueError(f"Tool class {pack_cls} must be a subclass of BaseToolSpec.")
......
......@@ -39,7 +39,7 @@ name = "llama-index"
packages = [{include = "llama_index"}]
readme = "README.md"
repository = "https://github.com/run-llama/llama_index"
version = "0.9.6.post1"
version = "0.9.6.post2"
[tool.poetry.dependencies]
SQLAlchemy = {extras = ["asyncio"], version = ">=1.4.49"}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment