tuned the parameters for generation
Browse files
app.py
CHANGED
@@ -43,7 +43,10 @@ def llama_generation(input_text: str,
|
|
43 |
|
44 |
# llama generation looks for the numeric vectors not the tensors so there is no need for **input_ids rather just input_ids
|
45 |
output_ids = llama_model.generate(input_ids=input_ids,
|
46 |
-
max_new_tokens=256
|
|
|
|
|
|
|
47 |
|
48 |
# Decode
|
49 |
output_text = llama_tokenizer.decode(output_ids[0],
|
|
|
43 |
|
44 |
# llama generation looks for the numeric vectors not the tensors so there is no need for **input_ids rather just input_ids
|
45 |
output_ids = llama_model.generate(input_ids=input_ids,
|
46 |
+
max_new_tokens=256,
|
47 |
+
temperature=0.7,
|
48 |
+
top_p=0.9,
|
49 |
+
repetition_penalty=2.0)
|
50 |
|
51 |
# Decode
|
52 |
output_text = llama_tokenizer.decode(output_ids[0],
|