RichardErkhov commited on
Commit
024a0ad
1 Parent(s): a358a67

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +82 -0
README.md ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ phi-1_5_chat_128k - bnb 4bits
11
+ - Model creator: https://huggingface.co/voidful/
12
+ - Original model: https://huggingface.co/voidful/phi-1_5_chat_128k/
13
+
14
+
15
+
16
+
17
+ Original model description:
18
+ ---
19
+ language:
20
+ - en
21
+ license: mit
22
+ ---
23
+
24
+ ## Model Summary
25
+
26
+ The language model Phi-1.5 is a Transformer with **1.3 billion** parameters. It was trained using the same data sources as [phi-1](https://huggingface.co/microsoft/phi-1), augmented with a new data source that consists of various NLP synthetic texts. When assessed against benchmarks testing common sense, language understanding, and logical reasoning, Phi-1.5 demonstrates a nearly state-of-the-art performance among models with less than 10 billion parameters.
27
+
28
+ We've trained Microsoft Research's phi-1.5, 1.3B parameter model with multi-turn conversation datasets on at most 32k and extended to 128k.
29
+
30
+ ## Example
31
+ ```python
32
+ import torch
33
+ from transformers import AutoModelForCausalLM, AutoTokenizer
34
+
35
+ torch.set_default_device("cuda")
36
+
37
+ model = AutoModelForCausalLM.from_pretrained("voidful/phi-1_5_chat_32k")
38
+ tokenizer = AutoTokenizer.from_pretrained("voidful/phi-1_5_chat_32k",device_map="auto")
39
+
40
+ messages = [
41
+ {
42
+ "role": "system",
43
+ "content": "You are a helpful assistant.",
44
+ },
45
+ {"role": "user", "content": "how to make a keyboard?"},
46
+ {"role": "assistant", "content": """To make a keyboard, you will need the following materials:
47
+
48
+ 1. A set of keys, such as those found on a standard computer keyboard.
49
+ 2. A circuit board, such as a MOSFET (Metal-Oxide-Semiconductor-Fluorescent) board.
50
+ 3. A power supply to provide power to the circuit board.
51
+ 4. A case to enclose the circuit board and protect it from damage.
52
+ 5. A soldering iron and solder to connect the components together.
53
+
54
+ Here is a basic outline of the steps involved in making a keyboard:
55
+
56
+ 1. Connect the circuit board to the power supply and the case.
57
+ 2. Connect the MOSFETs to the power supply and the case, using a soldering iron and solder.
58
+ 3. Connect the keys to the circuit board, using a soldering iron and solder.
59
+ 4. Test the keyboard to ensure that it works properly.
60
+ 5. Package the keyboard in a box or case for shipping or sale.
61
+
62
+ Note that this is just a basic outline, and there are many additional steps and considerations that will depend on the specific design and requirements of your keyboard.</s>"""},
63
+ {"role": "user", "content": "where to buy the circuit?"},
64
+ ]
65
+ tokenized_chat = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
66
+
67
+ outputs = model.generate(tokenized_chat, max_length=1024)
68
+ text = tokenizer.batch_decode(outputs[:,tokenized_chat.shape[-1]:-1])[0]
69
+ print(text)
70
+ ```
71
+
72
+ ### Result
73
+ ```
74
+ There are several places where you can buy a circuit board. Here are some of the most common places:
75
+
76
+ 1. Electronics stores: Many electronics stores carry a variety of circuit boards for different purposes.
77
+ 2. Online marketplaces: There are several online marketplaces where you can buy circuit boards, such as Amazon, eBay, and Alibaba.
78
+ 3. Specialty stores: There are several specialty stores that carry a variety of circuit boards for different purposes, such as hobby stores, craft stores, and home improvement stores.
79
+
80
+ In general, it is a good idea to shop around and compare prices and features before making a purchase.
81
+ ```
82
+