Upload briaai_FIBO_1.py with huggingface_hub
Browse files- briaai_FIBO_1.py +10 -4
briaai_FIBO_1.py
CHANGED
|
@@ -4,6 +4,8 @@
|
|
| 4 |
# "numpy",
|
| 5 |
# "einops",
|
| 6 |
# "pandas",
|
|
|
|
|
|
|
| 7 |
# "protobuf",
|
| 8 |
# "torch",
|
| 9 |
# "sentencepiece",
|
|
@@ -19,11 +21,13 @@
|
|
| 19 |
# ///
|
| 20 |
|
| 21 |
try:
|
|
|
|
| 22 |
from diffusers import DiffusionPipeline
|
| 23 |
|
| 24 |
-
|
|
|
|
| 25 |
|
| 26 |
-
prompt = "
|
| 27 |
image = pipe(prompt).images[0]
|
| 28 |
with open('briaai_FIBO_1.txt', 'w', encoding='utf-8') as f:
|
| 29 |
f.write('Everything was good in briaai_FIBO_1.txt')
|
|
@@ -39,11 +43,13 @@ except Exception as e:
|
|
| 39 |
with open('briaai_FIBO_1.txt', 'a', encoding='utf-8') as f:
|
| 40 |
import traceback
|
| 41 |
f.write('''```CODE:
|
|
|
|
| 42 |
from diffusers import DiffusionPipeline
|
| 43 |
|
| 44 |
-
|
|
|
|
| 45 |
|
| 46 |
-
prompt = "
|
| 47 |
image = pipe(prompt).images[0]
|
| 48 |
```
|
| 49 |
|
|
|
|
| 4 |
# "numpy",
|
| 5 |
# "einops",
|
| 6 |
# "pandas",
|
| 7 |
+
# "matplotlib",
|
| 8 |
+
# "paddleorc",
|
| 9 |
# "protobuf",
|
| 10 |
# "torch",
|
| 11 |
# "sentencepiece",
|
|
|
|
| 21 |
# ///
|
| 22 |
|
| 23 |
try:
|
| 24 |
+
import torch
|
| 25 |
from diffusers import DiffusionPipeline
|
| 26 |
|
| 27 |
+
# switch to "mps" for apple devices
|
| 28 |
+
pipe = DiffusionPipeline.from_pretrained("briaai/FIBO", dtype=torch.bfloat16, device_map="cuda")
|
| 29 |
|
| 30 |
+
prompt = "A man holding a goose while screaming"
|
| 31 |
image = pipe(prompt).images[0]
|
| 32 |
with open('briaai_FIBO_1.txt', 'w', encoding='utf-8') as f:
|
| 33 |
f.write('Everything was good in briaai_FIBO_1.txt')
|
|
|
|
| 43 |
with open('briaai_FIBO_1.txt', 'a', encoding='utf-8') as f:
|
| 44 |
import traceback
|
| 45 |
f.write('''```CODE:
|
| 46 |
+
import torch
|
| 47 |
from diffusers import DiffusionPipeline
|
| 48 |
|
| 49 |
+
# switch to "mps" for apple devices
|
| 50 |
+
pipe = DiffusionPipeline.from_pretrained("briaai/FIBO", dtype=torch.bfloat16, device_map="cuda")
|
| 51 |
|
| 52 |
+
prompt = "A man holding a goose while screaming"
|
| 53 |
image = pipe(prompt).images[0]
|
| 54 |
```
|
| 55 |
|