Edit model card

Model Summary

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, 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.

We've trained Microsoft Research's phi-1.5, 1.3B parameter model with multi-turn conversation datasets and extended to 32k.

How to Use

Phi-1.5 has been integrated in the transformers version 4.37.0. If you are using a lower version, ensure that you are doing the following:

  • When loading the model, ensure that trust_remote_code=True is passed as an argument of the from_pretrained() function.

The current transformers version can be verified with: pip list | grep transformers.

Example

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

torch.set_default_device("cuda")

model = AutoModelForCausalLM.from_pretrained("voidful/phi-1_5_chat_32k")
tokenizer = AutoTokenizer.from_pretrained("voidful/phi-1_5_chat_32k",device_map="auto")

from fastchat.conversation import get_conv_template
conv = get_conv_template('qwen-7b-chat')
conv.append_message(conv.roles[0], "how to make a keyboard?")
conv.append_message(conv.roles[1], """To make a keyboard, you will need the following materials:

1. A set of keys, such as those found on a standard computer keyboard.
2. A circuit board, such as a MOSFET (Metal-Oxide-Semiconductor-Fluorescent) board.
3. A power supply to provide power to the circuit board.
4. A case to enclose the circuit board and protect it from damage.
5. A soldering iron and solder to connect the components together.

Here is a basic outline of the steps involved in making a keyboard:

1. Connect the circuit board to the power supply and the case.
2. Connect the MOSFETs to the power supply and the case, using a soldering iron and solder.
3. Connect the keys to the circuit board, using a soldering iron and solder.
4. Test the keyboard to ensure that it works properly.
5. Package the keyboard in a box or case for shipping or sale.

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>""")
conv.append_message(conv.roles[0], "where to buy the circuit?")
prompt = conv.get_prompt()

inputs = tokenizer(prompt, return_tensors="pt", return_attention_mask=True)
outputs = model.generate(**inputs, max_length=1024)
text = tokenizer.batch_decode(outputs[:,inputs.input_ids.shape[-1]:])[0]
print(text)

Result


You can buy the circuit board from a variety of sources, including:

1. Online retailers: There are many online retailers that sell circuit boards, including Amazon, Best Buy, and Walmart.
2. Electronics stores: Many electronics stores, such as Best Buy, Walmart, and Target, carry circuit boards.
3. Specialty stores: There are also specialty stores that sell circuit boards, such as Circuit City, Best Buy, and Walmart.

When buying a circuit board, it is important to consider factors such as the size and type of circuit board, the quality and reliability of the circuit board, and the cost and availability of the circuit board.<|im_end|>
Downloads last month
2,598
Safetensors
Model size
1.54B params
Tensor type
BF16
·