dalaipy
A Python Wrapper for Dalai!
Dalai is a simple, and easy way to run LLaMa and Alpaca locally.
Installation
pip install dalaipy==2.0.2
https://pypi.org/project/dalaipy/2.0.2/
Instructions
- Go to Dalai, and set up your model of choice on your system (either Mac, Windows, or Linux). The readme provides clear explanations!
- Once you can run
npx dalai serve, run the server and test out your model of choice. - Install dalaipy per the instructions above, and make your first request:
from dalaipy.src import Dalai
model = Dalai()
# your_model can be one of the following, "alpaca.7B", "alpaca.13B", "llama.7B", "llama.13B", "llama.30B", or "llama.65B", and is dictated by which model you installed
request_dict = model.generate_request("What is the capital of the United States?", your_model)
print(model.request(request_dict))
Credits
@cocktailpeanut - the owner of Dalai
@quadrismegistus - made a notebook with the original idea of using python-socketio to communicate with the web server
Docs
Dalai Class
-
generate_request() -
model.generate_request(prompt, model)prompt: (required) the prompt stringmodel: (required) the model that should be used, in the form of a stringalpaca.7Balpaca.13Bllama.7Bllama.13Bllama.30Bllama.65B
id: the request ID (defaut is '0')n_predict: the number of tokens to return (default is 128)repeat_last_n: default is 64repeat_penalty: default is 1.3seed: the seed (default is -1)temp: the temperature of the request (default is 0.5)threads: the number of threads to use (default is 4)top_k: default is 40top_p: default is 0.9
-
request() -
model.request(prompt)prompt: (required) the prompt stringprettify: whether or not to clean and output just the string, or the whole request dictionary (default isTrue)
Metadata
Release files for dalaipy 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dalaipy-2.0.2.tar.gz | 4.0 kB | Without provenance | Details for dalaipy-2.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dalaipy-2.0.2-py3-none-any.whl | Python 3 | none | any | Details for dalaipy-2.0.2-py3-none-any.whl |
Total release size: 8.3 kB
Release files / dalaipy-2.0.2.tar.gz
| Download URL | dalaipy-2.0.2.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
493187643ef7b0d03a6dea2034fd9d7b5b41f020a62b74f2d2b00e3c59f98236
|
|
BLAKE2b-256 checksum How to use checksums |
155278808d5404efb9a1bdae624e96b4cd75351ac94776b9f416a745a682b04a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Release files / dalaipy-2.0.2-py3-none-any.whl
| Download URL | dalaipy-2.0.2-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c1a3a1893a413e7a8f14889cab2b2f10bf81f22cd54b41c1917e5a2e2fa6cdbb
|
|
BLAKE2b-256 checksum How to use checksums |
f3f3760243b546fe6041c8c34da65b376bfe4535c2637b8c5a3983c3991be59d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Security for dalaipy 2.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.