Update README.md
Browse files
README.md
CHANGED
@@ -60,7 +60,7 @@ This is the first version of Bakpia.
|
|
60 |
|
61 |
## Use
|
62 |
```
|
63 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
64 |
|
65 |
tokenizer = AutoTokenizer.from_pretrained("afrizalha/Bakpia-V1-1.5B-Javanese")
|
66 |
model = AutoModelForCausalLM.from_pretrained("afrizalha/Bakpia-V1-1.5B-Javanese")
|
@@ -74,7 +74,7 @@ template = """<|im_start|>system
|
|
74 |
|
75 |
input = template.format(prompt="Kados pundi kulo saged nyinaoni Basa Jawa kanthi sae?"
|
76 |
input = tokenizer([input], return_tensors = "pt").to("cuda")
|
77 |
-
outputs = model.generate(**input, max_new_tokens = 1024, temperature=.5, use_cache=False, do_sample=True)
|
78 |
print(tokenizer.batch_decode(outputs)[0])
|
79 |
```
|
80 |
|
|
|
60 |
|
61 |
## Use
|
62 |
```
|
63 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer
|
64 |
|
65 |
tokenizer = AutoTokenizer.from_pretrained("afrizalha/Bakpia-V1-1.5B-Javanese")
|
66 |
model = AutoModelForCausalLM.from_pretrained("afrizalha/Bakpia-V1-1.5B-Javanese")
|
|
|
74 |
|
75 |
input = template.format(prompt="Kados pundi kulo saged nyinaoni Basa Jawa kanthi sae?"
|
76 |
input = tokenizer([input], return_tensors = "pt").to("cuda")
|
77 |
+
outputs = model.generate(**input, max_new_tokens = 1024, streamer= TextStreamer(tokenizer), temperature=.5, use_cache=False, do_sample=True)
|
78 |
print(tokenizer.batch_decode(outputs)[0])
|
79 |
```
|
80 |
|