Update README.md
Browse files
README.md
CHANGED
@@ -11,12 +11,27 @@ tags:
|
|
11 |
- trl
|
12 |
---
|
13 |
|
14 |
-
|
|
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
- **Finetuned from model :** unsloth/gemma-2-9b-bnb-4bit
|
19 |
|
20 |
-
|
|
|
21 |
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
- trl
|
12 |
---
|
13 |
|
14 |
+
```
|
15 |
+
prompt = """You are tasked with writing a poem in the style of the poet mentioned below. The poem should fit the specified category and adhere to the poet's distinctive tone, language, and themes.
|
16 |
|
17 |
+
### Poet:
|
18 |
+
{}
|
|
|
19 |
|
20 |
+
### Category:
|
21 |
+
{}
|
22 |
|
23 |
+
### Poem:
|
24 |
+
{}"""
|
25 |
+
|
26 |
+
inputs = tokenizer(
|
27 |
+
[
|
28 |
+
prompt.format(
|
29 |
+
"সুনীল গঙ্গোপাধ্যায়",
|
30 |
+
"প্রেমমূলক",
|
31 |
+
"",
|
32 |
+
)
|
33 |
+
], return_tensors = "pt").to("cuda")
|
34 |
+
|
35 |
+
outputs = model.generate(**inputs, max_new_tokens = 256, use_cache = True)
|
36 |
+
tokenizer.batch_decode(outputs)
|
37 |
+
```
|