Update README.md
Browse files
README.md
CHANGED
@@ -64,6 +64,7 @@ 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")
|
|
|
67 |
|
68 |
template = """<|im_start|>system
|
69 |
<|im_end|>
|
@@ -72,7 +73,7 @@ template = """<|im_start|>system
|
|
72 |
<|im_start|>assistant
|
73 |
"""
|
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 |
```
|
|
|
64 |
|
65 |
tokenizer = AutoTokenizer.from_pretrained("afrizalha/Bakpia-V1-1.5B-Javanese")
|
66 |
model = AutoModelForCausalLM.from_pretrained("afrizalha/Bakpia-V1-1.5B-Javanese")
|
67 |
+
model.to("cuda")
|
68 |
|
69 |
template = """<|im_start|>system
|
70 |
<|im_end|>
|
|
|
73 |
<|im_start|>assistant
|
74 |
"""
|
75 |
|
76 |
+
input = template.format(prompt="Kados pundi kulo saged nyinaoni Basa Jawa kanthi sae?")
|
77 |
input = tokenizer([input], return_tensors = "pt").to("cuda")
|
78 |
outputs = model.generate(**input, max_new_tokens = 1024, streamer= TextStreamer(tokenizer), temperature=.5, use_cache=False, do_sample=True)
|
79 |
```
|