mwitiderrick commited on
Commit
2f49d44
·
1 Parent(s): 5f7558e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +23 -0
README.md CHANGED
@@ -23,6 +23,29 @@ There are several factors to consider when choosing a university:
23
  5. Faculty: The faculty of the university should be good. This will ensure that professors have knowledge of the subject.
24
  6. Faculty: The faculty of the university should be good. This will ensure that professors have knowledge of the subject.
25
  """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  ```
27
  ## One-shot and Export
28
 
 
23
  5. Faculty: The faculty of the university should be good. This will ensure that professors have knowledge of the subject.
24
  6. Faculty: The faculty of the university should be good. This will ensure that professors have knowledge of the subject.
25
  """
26
+ ```
27
+ ## With Repetition Penalty
28
+
29
+ ```python
30
+ from deepsparse import TextGeneration
31
+
32
+ generation_config = {
33
+ "repetition_penalty": 1.1,
34
+ "do_sample": True,
35
+ "max_new_tokens": 500,
36
+ }
37
+
38
+ prompt = "How to get in a good university?"
39
+ formatted_prompt = f"<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n"
40
+
41
+ model = TextGeneration(model="hf:nm-testing/TinyLlama-1.1B-Chat-v0.4-pruned60-quant")
42
+
43
+ print(model(formatted_prompt, generation_config=generation_config,).generations[0].text)
44
+ """
45
+ The university is one of the best options for students. It provides the right atmosphere for studying. The
46
+
47
+ """"
48
+
49
  ```
50
  ## One-shot and Export
51