Skip to content

Commit

Permalink
docs(readme): update usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Dec 20, 2024
1 parent 344fe5b commit 361e673
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,19 @@ For get a GGUF model or quantize manually, see [`Prepare and Quantize`](https://

## Usage

Load model info only:

```js
import { initLlama, loadLlamaModelInfo } from 'llama.rn'
import { loadLlamaModelInfo } from 'llama.rn'

const modelPath = 'file://<path to gguf model>'
console.log('Model Info:', await loadLlamaModelInfo(modelPath))
```

// Load the Llama model information pre initializing the Llama context
const modelPath = 'file://<path to gguf model>';
await loadLlamaModelInfo(modelPath);
Initialize a Llama context & do completion:

```js
import { initLlama } from 'llama.rn'

// Initial a Llama context with the model (may take a while)
const context = await initLlama({
Expand Down

0 comments on commit 361e673

Please sign in to comment.