Instructions to use JiaxinGe/Diffusers-BAGEL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use JiaxinGe/Diffusers-BAGEL with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("JiaxinGe/Diffusers-BAGEL", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
fix device
Browse files- pipeline.py +1 -1
pipeline.py
CHANGED
|
@@ -6819,7 +6819,7 @@ class InterleaveInferencer:
|
|
| 6819 |
past_key_values = gen_context['past_key_values']
|
| 6820 |
kv_lens = gen_context['kv_lens']
|
| 6821 |
ropes = gen_context['ropes']
|
| 6822 |
-
|
| 6823 |
generation_input = self.model.prepare_start_tokens(kv_lens, ropes, self.new_token_ids)
|
| 6824 |
generation_input = self._to_device(generation_input, device)
|
| 6825 |
unpacked_latent = self.model.generate_text(
|
|
|
|
| 6819 |
past_key_values = gen_context['past_key_values']
|
| 6820 |
kv_lens = gen_context['kv_lens']
|
| 6821 |
ropes = gen_context['ropes']
|
| 6822 |
+
device = next(self.model.parameters()).device
|
| 6823 |
generation_input = self.model.prepare_start_tokens(kv_lens, ropes, self.new_token_ids)
|
| 6824 |
generation_input = self._to_device(generation_input, device)
|
| 6825 |
unpacked_latent = self.model.generate_text(
|