Added example for chat template
Browse files
README.md
CHANGED
|
@@ -77,8 +77,32 @@ def generate_output(user_query, sys_prompt=DEFAULT_SYSTEM_PROMPT):
|
|
| 77 |
|
| 78 |
user_query = "Türkiye'de kaç il var?"
|
| 79 |
response = generate_output(user_query)
|
|
|
|
| 80 |
```
|
| 81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
## Limitations, Risks, Bias, and Ethical Considerations
|
| 83 |
|
| 84 |
### Limitations and Known Biases
|
|
|
|
| 77 |
|
| 78 |
user_query = "Türkiye'de kaç il var?"
|
| 79 |
response = generate_output(user_query)
|
| 80 |
+
print(response)
|
| 81 |
```
|
| 82 |
|
| 83 |
+
with chat template:
|
| 84 |
+
```python
|
| 85 |
+
pipe = pipeline("conversational",
|
| 86 |
+
model=model,
|
| 87 |
+
tokenizer=tokenizer,
|
| 88 |
+
device_map="auto",
|
| 89 |
+
max_new_tokens=1024,
|
| 90 |
+
repetition_penalty=1.1
|
| 91 |
+
)
|
| 92 |
+
|
| 93 |
+
messages = [
|
| 94 |
+
{
|
| 95 |
+
"role": "system",
|
| 96 |
+
"content": "Sen yardımsever bir chatbotsun. Sana verilen diyalog akışına dikkat ederek diyaloğu devam ettir.",
|
| 97 |
+
},
|
| 98 |
+
{"role": "user", "content": "Türkiye'de kaç il var?"}
|
| 99 |
+
]
|
| 100 |
+
|
| 101 |
+
outputs = pipe(messages, **sampling_params)
|
| 102 |
+
print(outputs)
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
|
| 106 |
## Limitations, Risks, Bias, and Ethical Considerations
|
| 107 |
|
| 108 |
### Limitations and Known Biases
|