Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
docs(readme): update example of using as a library (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
fardeon authored Mar 22, 2023
1 parent 42b8493 commit 3fe56e8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,25 @@ For a complete list of environment variables, see [`__init__.py`](https://github

#### Using as a Python Library

Basaran is also available as a library on [PyPI](https://pypi.org/project/basaran/). To use it programmatically, install it with `pip`:
Basaran is also available as a library on [PyPI](https://pypi.org/project/basaran/) for programmatic usage.

1. Install with `pip`:

```bash
pip install basaran
```

Use the `load_model` function to load the specified model and generate streaming output by calling the model:
2. Use the `load_model` function to load a model:

```python
from basaran.model import load_model

model = load_model("user/repo")
```

3. Generate streaming output by calling the model:

```python
for choice in model("once upon a time"):
print(choice)
```
Expand Down

0 comments on commit 3fe56e8

Please sign in to comment.