File size: 2,203 Bytes
c50d548
 
c0e7423
 
 
 
 
 
 
 
c50d548
c0e7423
d4a16c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c0e7423
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bb5f861
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
license: apache-2.0
datasets:
- Open-Orca/SlimOrca
language:
- en
pipeline_tag: text-generation
inference: false
tags:
- text-generation-inference
---

# 🌟 Falcon-RW-1B-Instruct-OpenOrca

Falcon-RW-1B-Instruct-OpenOrca is a 1B parameter, causal decoder-only model based on [Falcon-RW-1B](https://huggingface.co/tiiuae/falcon-rw-1b) and finetuned on the [Open-Orca/SlimOrca](https://huggingface.co/datasets/Open-Orca/SlimOrca) dataset.

**πŸš€ Motivations**
1. To create a smaller, open-source, instruction-finetuned, ready-to-use model accessible for users with limited computational resources; to make a decent ready-to-use model for running on lower-end consumer GPUs.
2. To harness the strength of Falcon-RW-1B, a competitive model in its own right, and enhance its capabilities with instruction finetuning.

## πŸ“– How to Use

 The model operates with a structured prompt format, incorporating `<SYS>`, `<INST>`, and `<RESP>` tags to demarcate different parts of the input. The system message and instruction are placed within these tags, with the `<RESP>` tag triggering the model's response.

### πŸ“ Example Code

 ```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch

model = 'ericzzz/falcon-rw-1b-instruct-openorca'

tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    tokenizer=tokenizer,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

system_message = "You are a helpful assistant. Give short answers."
instruction = "What is AI? Give some examples."
prompt = f"<SYS> {system_message} <INST> {instruction} <RESP> "

response = pipeline(
    prompt, 
    max_length=200,
    repetition_penalty=1.05
)

print(response[0]['generated_text'])
# AI, or Artificial Intelligence, refers to the ability of machines and software to perform tasks that require human intelligence, such as learning, reasoning, and problem-solving. It can be used in various fields like computer science, engineering, medicine, and more. Some common applications include image recognition, speech translation, and natural language processing.
```

## Contact
eric.fu96@aol.com