Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BLOOM, a version for Petals
|
| 2 |
+
|
| 3 |
+
This model is a version of [bigscience/bloom-7b1](https://huggingface.co/bigscience/bloom-7b1)
|
| 4 |
+
post-processed to be run at home using the [Petals](https://github.com/bigscience-workshop/petals#readme) swarm.
|
| 5 |
+
|
| 6 |
+
**Note:** Petals is developed to run 100B+ models
|
| 7 |
+
like the [full-scale BLOOM](https://huggingface.co/bigscience/bloom-petals) or [BLOOMZ](https://huggingface.co/bigscience/bloomz-petals).
|
| 8 |
+
This model is provided for testing purposes only. It may be more efficient to run the original version of it locally.
|
| 9 |
+
|
| 10 |
+
Please check out:
|
| 11 |
+
|
| 12 |
+
- The [original model card](https://huggingface.co/bigscience/bloom-7b1)
|
| 13 |
+
to learn about the model's capabilities, specifications, and terms of use.
|
| 14 |
+
- The [Petals repository](https://github.com/bigscience-workshop/petals#readme)
|
| 15 |
+
to learn how to install Petals and run this model over the Petals swarm.
|
| 16 |
+
|
| 17 |
+
We provide minimal code examples below.
|
| 18 |
+
|
| 19 |
+
## Using the model
|
| 20 |
+
|
| 21 |
+
```python
|
| 22 |
+
from petals import DistributedBloomForCausalLM
|
| 23 |
+
|
| 24 |
+
model = DistributedBloomForCausalLM.from_pretrained("bigscience/bloom-7b1-petals")
|
| 25 |
+
# Embeddings & prompts are on your device, BLOOM blocks are distributed across the Internet
|
| 26 |
+
|
| 27 |
+
inputs = tokenizer("A cat sat", return_tensors="pt")["input_ids"]
|
| 28 |
+
outputs = model.generate(inputs, max_new_tokens=5)
|
| 29 |
+
print(tokenizer.decode(outputs[0])) # A cat sat on a mat...
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
## Serving the model blocks
|
| 33 |
+
|
| 34 |
+
```bash
|
| 35 |
+
python -m petals.cli.run_server bigscience/bloom-7b1-petals
|
| 36 |
+
```
|