File size: 2,221 Bytes
4afd17e
 
0a1e36d
 
 
 
 
 
 
 
 
 
f4cd6a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9c6e75a
 
 
 
4afd17e
e2be583
 
 
49e4469
 
 
 
e0d26bd
 
 
e2be583
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4aed4c8
 
 
e2be583
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
---
license: mit
datasets:
- databricks/databricks-dolly-15k
language:
- en
pipeline_tag: text-generation
tags:
- dolly
- dolly-v2
- instruct
- sharded
widget:
  - text: Imagine Einstein was part of a comedy duo. What would be their stage name?
    example_title: Einstein's comedy duo
  - text: What do you think Einstein's favorite Swiss chocolate brand would be?
    example_title: Einstein's chocolate
  - text: If Einstein were to enter a yodeling competition in Switzerland, what
      would his yodel sound like?
    example_title: Einstein's yodel
  - text: If Einstein had to create a Swiss-themed superhero, what would their name
      and superpower be?
    example_title: Swiss superhero
  - text: What kind of wild party would Einstein throw at ETH Zurich?
    example_title: Einstein's party
  - text: If Einstein had a pet Swiss cow, what would he name it and why?
    example_title: Einstein's cow
  - text: You've discovered a secret Swiss cheese that grants the power of genius.
      How would you use it to become the next Einstein?
    example_title: Genius cheese
inference:
  parameters:
    max_length: 64
    min_length: 32
---

# dolly-v2-7b: sharded checkpoint 

<a href="https://colab.research.google.com/gist/pszemraj/6eb7ccce28ea6aa07b8ec86388ac010e/sharded-instruction-model-playground.ipynb">
  <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
</a>

This is a sharded checkpoint (with ~4GB shards) of the `databricks/dolly-v2-7b` model. Refer to the [original model](https://huggingface.co/databricks/dolly-v2-7b) for all details.

- this enables low-RAM loading, i.e. Colab :)

## Basic Usage


install `transformers`, `accelerate`, and `bitsandbytes`.

```bash
pip install -U -q transformers bitsandbytes accelerate
```

Load the model in 8bit, then [run inference](https://huggingface.co/docs/transformers/generation_strategies#contrastive-search):

```python
from transformers import AutoTokenizer, AutoModelForCausalLM

model_name = "ethzanalytics/dolly-v2-7b-sharded"
tokenizer = AutoTokenizer.from_pretrained(model_name)

model = AutoModelForCausalLM.from_pretrained(
          model_name, load_in_8bit=True, device_map="auto",
        )
```