模型:
bigscience/bloom-petals
该模型是经过后处理的 bigscience/bloom 版本,可以在家中使用 Petals 群集运行。
请查看:
我们提供以下的最小代码示例。
from petals import DistributedBloomForCausalLM
model = DistributedBloomForCausalLM.from_pretrained("bigscience/bloom-petals")
# Embeddings & prompts are on your device, BLOOM blocks are distributed across the Internet
inputs = tokenizer("A cat sat", return_tensors="pt")["input_ids"]
outputs = model.generate(inputs, max_new_tokens=5)
print(tokenizer.decode(outputs[0])) # A cat sat on a mat...
python -m petals.cli.run_server bigscience/bloom-petals