File size: 1,299 Bytes
e771915 a7c925f e771915 |
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 |
# 🚀 Falcon-7B 8-bit Model
This repository is home to the 8-bit of Falcon-7B model, converted from its original model (https://huggingface.co/tiiuae/falcon-7b).
Falcon-7B is a 7B parameters causal decoder-only model built by TII and trained on 1,500B tokens of RefinedWeb enhanced with curated corpora. It is made available under the Apache 2.0 license.
Usage
You can use this model directly with a pipeline for tasks such as text generation and instruction following:
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch
model = "cambioml/falcon-7b-8bit"
tokenizer = AutoTokenizer.from_pretrained(model)
pipe = transformers.pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device_map="auto",
)
sequences = pipe(
"Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:",
max_length=200,
do_sample=True,
top_k=10,
num_return_sequences=1,
eos_token_id=tokenizer.eos_token_id,
)
for seq in sequences:
print(f"Result: {seq['generated_text']}")
``` |