TheBloke commited on
Commit
5539714
1 Parent(s): 9fd36c2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +9 -5
README.md CHANGED
@@ -86,11 +86,15 @@ logging.set_verbosity(logging.CRITICAL)
86
 
87
  pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
88
 
89
- prompt_template = "<|system|>\n<|end|>\n<|user|>\n{query}<|end|>\n<|assistant|>"
90
- prompt = prompt_template.format(query="How do I sort a list in Python?")
91
- # We use a special <|end|> token with ID 49155 to denote ends of a turn
92
- outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.2, top_k=50, top_p=0.95, eos_token_id=49155)
93
- # You can sort a list in Python by using the sort() method. Here's an example:\n\n```\nnumbers = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]\nnumbers.sort()\nprint(numbers)\n```\n\nThis will sort the list in place and print the sorted list.
 
 
 
 
94
  print(outputs[0]['generated_text'])
95
  ```
96
 
 
86
 
87
  pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
88
 
89
+ prompt_template = '''Below is an instruction that describes a task. Write a response that appropriately completes the request
90
+
91
+ ### Instruction: {prompt}
92
+
93
+ ### Response:'''
94
+ prompt = prompt_template.format(prompt="How do I sort a list in Python?")
95
+
96
+ outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.2, top_k=50, top_p=0.95)
97
+
98
  print(outputs[0]['generated_text'])
99
  ```
100