Update README.md
Browse files
README.md
CHANGED
|
@@ -660,7 +660,7 @@ messages = [
|
|
| 660 |
|
| 661 |
output = generate_sample(
|
| 662 |
messages=messages,
|
| 663 |
-
max_new_tokens=256, temperature=0.
|
| 664 |
)
|
| 665 |
```
|
| 666 |
|
|
@@ -739,7 +739,7 @@ messages = [
|
|
| 739 |
|
| 740 |
output = generate_sample(
|
| 741 |
messages=messages,
|
| 742 |
-
max_new_tokens=256, temperature=0.
|
| 743 |
)
|
| 744 |
```
|
| 745 |
|
|
@@ -804,7 +804,7 @@ In addition, there are some things you need to know before using as follows:
|
|
| 804 |
|
| 805 |
#### Generation configuration
|
| 806 |
|
| 807 |
-
The **temperature** affects the truth of the answer. Setting a **temperature** value greater than 0.2 will result in a more creative answer but may affect the accuracy of the answer, please consider this based on your task.
|
| 808 |
|
| 809 |
Hint: you can write a prompt to receive input and ask the model to choose the appropriate temperature based on the question, useful in the case of virtual assistant development.
|
| 810 |
|
|
@@ -856,7 +856,7 @@ For direct use with `transformers`, you can easily get started with the followin
|
|
| 856 |
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
|
| 857 |
for k,v in inputs.items():
|
| 858 |
inputs[k] = v.cuda()
|
| 859 |
-
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=True, top_k=50, top_p=0.95, temperature=0.
|
| 860 |
results = tokenizer.batch_decode(outputs)[0]
|
| 861 |
print(results)
|
| 862 |
```
|
|
@@ -894,7 +894,7 @@ For direct use with `transformers`, you can easily get started with the followin
|
|
| 894 |
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
|
| 895 |
for k,v in inputs.items():
|
| 896 |
inputs[k] = v.cuda()
|
| 897 |
-
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=True, top_k=50, top_p=0.95, temperature=0.
|
| 898 |
results = tokenizer.batch_decode(outputs)[0]
|
| 899 |
print(results)
|
| 900 |
|
|
@@ -936,7 +936,7 @@ For direct use with `unsloth`, you can easily get started with the following ste
|
|
| 936 |
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
|
| 937 |
for k,v in inputs.items():
|
| 938 |
inputs[k] = v.cuda()
|
| 939 |
-
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=True, top_k=50, top_p=0.95, temperature=0.
|
| 940 |
results = tokenizer.batch_decode(outputs)[0]
|
| 941 |
print(results)
|
| 942 |
```
|
|
|
|
| 660 |
|
| 661 |
output = generate_sample(
|
| 662 |
messages=messages,
|
| 663 |
+
max_new_tokens=256, temperature=0.4, top_k=50, top_p=1,
|
| 664 |
)
|
| 665 |
```
|
| 666 |
|
|
|
|
| 739 |
|
| 740 |
output = generate_sample(
|
| 741 |
messages=messages,
|
| 742 |
+
max_new_tokens=256, temperature=0.4, top_k=50, top_p=1,
|
| 743 |
)
|
| 744 |
```
|
| 745 |
|
|
|
|
| 804 |
|
| 805 |
#### Generation configuration
|
| 806 |
|
| 807 |
+
The **temperature** affects the truth of the answer. Setting a **temperature** value greater than 0.2 - 0.4 will result in a more creative answer but may affect the accuracy of the answer, please consider this based on your task.
|
| 808 |
|
| 809 |
Hint: you can write a prompt to receive input and ask the model to choose the appropriate temperature based on the question, useful in the case of virtual assistant development.
|
| 810 |
|
|
|
|
| 856 |
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
|
| 857 |
for k,v in inputs.items():
|
| 858 |
inputs[k] = v.cuda()
|
| 859 |
+
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=True, top_k=50, top_p=0.95, temperature=0.4)
|
| 860 |
results = tokenizer.batch_decode(outputs)[0]
|
| 861 |
print(results)
|
| 862 |
```
|
|
|
|
| 894 |
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
|
| 895 |
for k,v in inputs.items():
|
| 896 |
inputs[k] = v.cuda()
|
| 897 |
+
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=True, top_k=50, top_p=0.95, temperature=0.4)
|
| 898 |
results = tokenizer.batch_decode(outputs)[0]
|
| 899 |
print(results)
|
| 900 |
|
|
|
|
| 936 |
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
|
| 937 |
for k,v in inputs.items():
|
| 938 |
inputs[k] = v.cuda()
|
| 939 |
+
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=True, top_k=50, top_p=0.95, temperature=0.4)
|
| 940 |
results = tokenizer.batch_decode(outputs)[0]
|
| 941 |
print(results)
|
| 942 |
```
|