tripathysagar
commited on
Commit
•
9a113d0
1
Parent(s):
325261f
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
---
|
4 |
+
```
|
5 |
+
from transformers import pipeline, GPT2Tokenizer, GPT2LMHeadModel, PreTrainedTokenizerFast
|
6 |
+
checkpoint = "tripathysagar/oida-gpt"
|
7 |
+
|
8 |
+
model = GPT2LMHeadModel.from_pretrained(checkpoint)
|
9 |
+
tokenizer = PreTrainedTokenizerFast.from_pretrained(checkpoint)
|
10 |
+
|
11 |
+
generator = pipeline('text-generation', model=model, tokenizer=tokenizer, device=device)
|
12 |
+
|
13 |
+
raw_inputs = [
|
14 |
+
"ଉଭୟ ଘଟଣାରେ ପରିବାର ଲୋକ",
|
15 |
+
"ଅଫିସ ସମୟ ପରେ କୌଣସି ଉପରିସ୍ଥ",
|
16 |
+
]
|
17 |
+
inputs = tokenizer(raw_inputs, padding=True, truncation=True, return_tensors="pt")
|
18 |
+
print(inputs)
|
19 |
+
output = generator(raw_inputs, max_length=75, num_return_sequences=1, truncation=True)
|
20 |
+
print(output)
|
21 |
+
```
|