afrizalha commited on
Commit
6b21661
1 Parent(s): bec84fc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +20 -0
README.md CHANGED
@@ -51,6 +51,26 @@ This is the first version of Bakpia.
51
  - Single-turn QA across various domains.
52
  - Ngoko Javanese not currently supported.
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  ## Uploaded model
55
 
56
  - **Developed by:** Afrizal Hasbi Azizy
 
51
  - Single-turn QA across various domains.
52
  - Ngoko Javanese not currently supported.
53
 
54
+ ## Use
55
+ ```
56
+ from transformers import AutoTokenizer, AutoModelForCausalLM
57
+
58
+ tokenizer = AutoTokenizer.from_pretrained("afrizalha/Bakpia-V1-1.5B-Javanese")
59
+ model = AutoModelForCausalLM.from_pretrained("afrizalha/Bakpia-V1-1.5B-Javanese")
60
+
61
+ template = """<|im_start|>system
62
+ <|im_end|>
63
+ <|im_start|>user
64
+ {prompt}<|im_end|>
65
+ <|im_start|>assistant
66
+ """
67
+
68
+ input = template.format(prompt="Kados pundi kulo saged nyinaoni Basa Jawa kanthi sae?"
69
+ input = tokenizer([input], return_tensors = "pt").to("cuda")
70
+ outputs = model.generate(**input, max_new_tokens = 32, temperature=.5, use_cache=False, do_sample=True)
71
+ print(tokenizer.batch_decode(outputs)[0])
72
+ ```
73
+
74
  ## Uploaded model
75
 
76
  - **Developed by:** Afrizal Hasbi Azizy