Skip to content

Allow local llama library usage #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 10, 2023
Merged

Allow local llama library usage #28

merged 6 commits into from
Apr 10, 2023

Conversation

SagsMug
Copy link
Contributor

@SagsMug SagsMug commented Apr 5, 2023

Sometimes its nice to try different library versions and different forks of llama etc (given they still use the same api).
This commit adds the local path as the first place to search for llama libraries.

@abetlen
Copy link
Owner

abetlen commented Apr 6, 2023

I agree we may need an escape hatch of sorts at the moment (e.g #30 ) and @MillionthOdin16 has brought this up previously in #12 .

I'm not sure the that using the local directory is the right solution, I would prefer something more explicit such as using an environment variable or even a custom function to update _lib in llama_cpp.

@SagsMug
Copy link
Contributor Author

SagsMug commented Apr 10, 2023

I agree we may need an escape hatch of sorts at the moment (e.g #30 ) and @MillionthOdin16 has brought this up previously in #12 .

I'm not sure the that using the local directory is the right solution, I would prefer something more explicit such as using an environment variable or even a custom function to update _lib in llama_cpp.

I made it into an environment variable.
A custom function will probably take a bigger refactor because of the way the library is loaded.

Copy link
Owner

@abetlen abetlen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SagsMug great work

@@ -25,6 +25,12 @@ def _load_shared_library(lib_base_name):
_base_path / f"{lib_base_name}{lib_ext}"
]

if ("LLAMA_LIB" in os.environ):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SagsMug great work, can we change the environment variable to LLAMA_CPP_LIB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SagsMug great work, can we change the environment variable to LLAMA_CPP_LIB

Done!

@abetlen abetlen merged commit 0460fdb into abetlen:main Apr 10, 2023
@SagsMug SagsMug deleted the local-lib branch April 10, 2023 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants