File size: 1,528 Bytes
d925cbb
f7bee05
 
 
4478636
f7bee05
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d925cbb
f7bee05
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4478636
f7bee05
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# 💬 **Join us in Chai Prize Competition** [**Discord**](https://discord.gg/7mXdjAkw2s)

# Model description

phase2_winner_13b was the winner model of [Phase2 Chai Prize Competition](https://www.chai-research.com/competition.html), based on [Llama-2-13b](https://huggingface.co/meta-llama/Llama-2-13b-hf).

# Submit model to Chai Prize Competition

Install the [Chai Guanaco package](https://pypi.org/project/chai-guanaco/):

```
pip install chai-guanaco
```

For one-off authentication run the following in your terminal:

```
chai-guanaco login
```

Submit model:

```python
import chai_guanaco as chai

model_url = "ChaiML/phase2_winner_13b2"

generation_parameters = {
    'temperature': 0.8,
    'top_p': 0.2,
    "top_k": 40,
    "stopping_words": ['\n'],
    "presence_penalty": 0.,
    "frequency_penalty": 0.,
    }

submission_parameters = {
    'model_repo': model_url,
    'generation_params': generation_parameters,
    }

submitter = chai.ModelSubmitter()
submission_id = submitter.submit(submission_parameters)
```

# Prompt formatting

```python
from chai_guanaco.formatters import PromptFormatter

class PygmalionFormatter(PromptFormatter):
    memory_template = "{bot_name}'s Persona: {memory}\n####\n"
    prompt_template = "{prompt}\n<START>\n"
    bot_template = "{bot_name}: {message}\n"
    user_template = "{user_name}: {message}\n"
    response_template = "{bot_name}:"
```

Example of model input:

```
{bot_name}'s Persona: {memory}
####
{prompt}
<START>
[Historical conversations]
{bot_name}:
```