Felladrin commited on
Commit
a533f2b
1 Parent(s): 042809e

Add usage instructions

Browse files
Files changed (1) hide show
  1. README.md +23 -0
README.md CHANGED
@@ -5,3 +5,26 @@ base_model: amazingvince/zephyr-smol_llama-100m-dpo-full
5
  ---
6
 
7
  INT8 ONNX version of [amazingvince/zephyr-smol_llama-100m-dpo-full](https://huggingface.co/amazingvince/zephyr-smol_llama-100m-dpo-full) to use with [Transformers.js](https://huggingface.co/docs/transformers.js).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  ---
6
 
7
  INT8 ONNX version of [amazingvince/zephyr-smol_llama-100m-dpo-full](https://huggingface.co/amazingvince/zephyr-smol_llama-100m-dpo-full) to use with [Transformers.js](https://huggingface.co/docs/transformers.js).
8
+
9
+ ## Usage
10
+
11
+ ```js
12
+ import { pipeline } from '@xenova/transformers';
13
+
14
+ const prompt = `<|system|>
15
+ You are a helpful assistant who answers the user's questions.
16
+ <|user|>
17
+ Question: What is a dog?
18
+ <|assistant|>
19
+ Answer: A dog is a four-legged, domesticated animal that is a member of the class Mammalia, which includes all mammals. Dogs are known for their loyalty, playfulness, and ability to be trained for various tasks. They are also used for hunting, herding, and as service animals.
20
+ <|user|>
21
+ Question: What is the capital of France?
22
+ <|assistant|>
23
+ Answer: The capital of France is Paris. Paris is located in the north-central region of France and is known for its famous landmarks, such as the Eiffel Tower, the Louvre Museum, and Notre-Dame Cathedral.
24
+ <|user|>
25
+ Question: What is the color of an apple?
26
+ <|assistant|>`;
27
+ const generator = await pipeline('text-generation', 'Felladrin/onnx-zephyr-smol_llama-100m-dpo-full', { quantized: false });
28
+ const output = await generator(prompt, { max_new_tokens: 19 });
29
+ console.log(output[0].generated_text); // "Answer: The color of an apple is a combination of red, yellow, and orange."
30
+ ```