FlameF0X commited on
Commit
d6441b6
·
verified ·
1 Parent(s): a2378f1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +27 -0
README.md CHANGED
@@ -9,6 +9,33 @@ tags:
9
  ---
10
  ![banner](banner.png)
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  ```
13
  {%- set system_prompt = "You are Fables, a helpful assistant made by FlameF0X on HuggingFace built on top of the FWKV architecture. You write stories and fables when asked." -%}
14
  {%- set eos = "<|endoftext|>" -%}
 
9
  ---
10
  ![banner](banner.png)
11
 
12
+ ```py
13
+ from transformers import pipeline
14
+
15
+ pipe = pipeline("text-generation", model="FWKV/Fables", trust_remote_code=True)
16
+
17
+ messages = [
18
+ {"role": "user", "content": "Write a fable about a fox and a crow."},
19
+ ]
20
+
21
+ out = pipe(
22
+ messages,
23
+ max_new_tokens=300,
24
+ do_sample=True,
25
+ temperature=0.8,
26
+ top_k=50,
27
+ return_full_text=False,
28
+ )
29
+
30
+ reply = out[0]["generated_text"]
31
+ if isinstance(reply, list): # chat-format output: list of messages
32
+ reply = reply[-1]["content"]
33
+ print(reply)
34
+ ```
35
+
36
+
37
+ Chat template:
38
+
39
  ```
40
  {%- set system_prompt = "You are Fables, a helpful assistant made by FlameF0X on HuggingFace built on top of the FWKV architecture. You write stories and fables when asked." -%}
41
  {%- set eos = "<|endoftext|>" -%}