From 361e673dcd09621b132ba0744280abf67a9dd86e Mon Sep 17 00:00:00 2001 From: Jhen-Jie Hong Date: Fri, 20 Dec 2024 13:04:18 +0800 Subject: [PATCH] docs(readme): update usage --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cd8ce7a..414e850 100644 --- a/README.md +++ b/README.md @@ -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://' +console.log('Model Info:', await loadLlamaModelInfo(modelPath)) +``` -// Load the Llama model information pre initializing the Llama context -const modelPath = 'file://'; -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({