TechxGenus commited on
Commit
1a14ea0
·
verified ·
1 Parent(s): 1a28bfc

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +37 -0
README.md ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ ---
4
+
5
+ ### bitnet_b1_58-3B-Coder
6
+
7
+ Code finetuned version of [bitnet_b1_58-3B](https://huggingface.co/1bitLLM/bitnet_b1_58-3B)
8
+
9
+ ### Usage
10
+
11
+ ```python
12
+ from tokenization_bitnet import BitnetTokenizer
13
+ from transformers import AutoModelForCausalLM
14
+ import torch
15
+ PROMPT = """### Instruction
16
+ {instruction}
17
+ ### Response
18
+ """
19
+ instruction = <Your code instruction here>
20
+ prompt = PROMPT.format(instruction=instruction)
21
+ tokenizer = BitnetTokenizer.from_pretrained(
22
+ "TechxGenus/bitnet_b1_58-3B-Coder",
23
+ trust_remote_code=True,
24
+ )
25
+ model = AutoModelForCausalLM.from_pretrained(
26
+ "TechxGenus/bitnet_b1_58-3B-Coder",
27
+ torch_dtype=torch.float16,
28
+ device_map="auto",
29
+ )
30
+ inputs = tokenizer.encode(prompt, return_tensors="pt")
31
+ outputs = model.generate(input_ids=inputs.to(model.device), max_new_tokens=2048)
32
+ print(tokenizer.decode(outputs[0]))
33
+ ```
34
+
35
+ ### Note
36
+
37
+ Model may sometimes make errors, produce misleading contents, or struggle to manage tasks that are not related to coding. It has undergone very limited testing. Additional safety testing should be performed before any real-world deployments.