File size: 5,415 Bytes
a858739
 
9aa3d34
 
 
 
e338cb0
a858739
e2c44ff
 
e338cb0
 
 
 
 
 
 
 
25680e9
e338cb0
 
aaaeba3
c56e062
66444e5
c56e062
66444e5
c56e062
191d228
 
 
d1438e2
e338cb0
 
191d228
e2c44ff
191d228
 
 
 
 
e2c44ff
 
 
 
fb2f194
e2c44ff
eb6cf53
e2c44ff
eb6cf53
e2c44ff
eb6cf53
e2c44ff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
eb6cf53
e2c44ff
c59532d
e2c44ff
 
 
e338cb0
 
 
 
 
ea9e87e
e338cb0
ea9e87e
e338cb0
 
420f94f
 
 
e338cb0
191d228
 
 
e338cb0
 
 
 
 
 
 
 
 
 
 
 
c519235
988448f
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
license: apache-2.0
language:
- en
tags:
- InstructGPT
- hf
---


# Camel 🐪 5B

<style>
img {
 display: inline;
}
</style>


## Model Description

Introducing Camel-5b, a state-of-the-art instruction-following large language model designed to deliver exceptional performance and versatility. Derived from the foundational architecture of [Palmyra-Base](https://huggingface.co/Writer/palmyra-base), Camel-5b is specifically tailored to address the growing demand for advanced natural language processing and comprehension capabilities.

The Camel-5b model is meticulously trained on an extensive dataset of approximately 70,000 instruction-response records. These records are generated by our dedicated Writer Linguist team, who possess considerable expertise in language modeling and fine-tuning techniques. By leveraging their skills and knowledge, the Camel-5b model is primed to offer unparalleled proficiency in understanding and executing language-based instructions.

One of the key differentiators of Camel-5b lies in its ability to process complex instructions and generate accurate, contextually appropriate responses. This makes it an ideal choice for a wide range of applications, including virtual assistants, customer support, content generation, and more. Additionally, the model's comprehensive training enables it to adapt and perform well under varying conditions and contexts, further expanding its potential use cases.


## Live Demo

Live demo => https://chatcamel.vercel.app/ 


## Deploying Camel

We used the [Baseten platform](http://baseten.co/) to package and serve Camel-5B at scale. Utilizing the open source [Truss](https://truss.baseten.co/) model packaging framework, users can create a customized environment using the simple instructions found on [GitHub](https://github.com/basetenlabs/camel-5b-truss). This repo allows users to maintain full control over the inference and deployment paths to meet their specific requirements. 
We would like to thank the Baseten team for their contributions in deploying and hosting the model.


## Usage :
```python
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

model_name = "Writer/camel-5b-hf"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    device_map="auto",
    torch_dtype=torch.float16
)

instruction = "Describe a futuristic device that revolutionizes space travel."


PROMPT_DICT = {
    "prompt_input": (
        "Below is an instruction that describes a task, paired with an input that provides further context. "
        "Write a response that appropriately completes the request\n\n"
        "### Instruction:\n{instruction}\n\n### Input:\n{input}\n\n### Response:"
    ),
    "prompt_no_input": (
        "Below is an instruction that describes a task. "
        "Write a response that appropriately completes the request.\n\n"
        "### Instruction:\n{instruction}\n\n### Response:"
    ),
}

text = (
    PROMPT_DICT["prompt_no_input"].format(instruction=instruction)
    if not input
    else PROMPT_DICT["prompt_input"].format(instruction=instruction, input=input)
)

model_inputs = tokenizer(text, return_tensors="pt").to("cuda")
output_ids = model.generate(
    **model_inputs,
    max_length=256,
)
output_text = tokenizer.batch_decode(output_ids, skip_special_tokens=True)[0]
clean_output = output_text.split("### Response:")[1].strip()

print(clean_output)
```


### Limitations and Biases

Camel's core functionality is to take a string of text and predict the next token. While language models are widely used for other tasks, there are many unknowns in this work. When prompting Camel, keep in mind that the next statistically likely token is not always the token that produces the most "accurate" text. Never rely on Camel to produce factually correct results.

Camel was trained on Writer’s custom data. As with all language models, it is difficult to predict how Camel will respond to specific prompts, and offensive content may appear unexpectedly. We recommend that the outputs be curated or filtered by humans before they are released, both to censor undesirable content and to improve the quality of the results.


## Camel VS. Llama

The Camel is essentially the Swiss Army knife of the animal kingdom - it can store water in its humps, survive extreme temperatures, and even provide a cushy ride for weary travelers. The llama, on the other hand, is basically just a glorified lawnmower with an attitude problem. Sure, they might have a cute, fuzzy face, but don't be deceived - one false move and you'll be greeted with a spit shower. The true MVP of the desert, and let the llama keep on spitting its way into obscurity.

<img src="https://i.postimg.cc/wjXZLQbB/Camel-Llama.png" width="400px" />


## Citation and Related Information


To cite this model:
```
@misc{Camel,
  author = {Writer Engineering team},
  title = {{Camel-5B InstructGPT}},
  howpublished = {\url{https://dev.writer.com}},
  year = 2023,
  month = April 
}
```
[![Model architecture](https://img.shields.io/badge/Model%20Arch-Transformer%20Decoder-green)](#model-architecture)|[![Model size](https://img.shields.io/badge/Params-5B-green)](#model-architecture)|[![Language](https://img.shields.io/badge/Language-en--US-lightgrey#model-badge)](#datasets)|![AUR license](https://img.shields.io/badge/license-Apache%202-blue)