Ruslan Magana Vsevolodovna
commited on
Commit
·
3ad339f
1
Parent(s):
f8e6d87
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,6 +47,8 @@ def get_output_video(text):
|
|
| 47 |
Set the dtype to torch.float16 to save GPU memory.
|
| 48 |
If you have an Ampere architecture GPU you can use torch.bfloat16.
|
| 49 |
Set the device to either "cuda" or "cpu". Once everything has finished initializing,
|
|
|
|
|
|
|
| 50 |
'''
|
| 51 |
|
| 52 |
def generate_image(
|
|
@@ -63,7 +65,7 @@ def get_output_video(text):
|
|
| 63 |
models_root=models_root,
|
| 64 |
is_reusable=True,
|
| 65 |
is_verbose=True,
|
| 66 |
-
dtype=torch.float16 if fp16 else torch.float32 ,#param ["float32", "float16", "bfloat16"]
|
| 67 |
#device='cuda' #'cpu'
|
| 68 |
)
|
| 69 |
#log_gpu_memory()
|
|
|
|
| 47 |
Set the dtype to torch.float16 to save GPU memory.
|
| 48 |
If you have an Ampere architecture GPU you can use torch.bfloat16.
|
| 49 |
Set the device to either "cuda" or "cpu". Once everything has finished initializing,
|
| 50 |
+
float32 is faster than float16 but uses more GPU memory.
|
| 51 |
+
|
| 52 |
'''
|
| 53 |
|
| 54 |
def generate_image(
|
|
|
|
| 65 |
models_root=models_root,
|
| 66 |
is_reusable=True,
|
| 67 |
is_verbose=True,
|
| 68 |
+
dtype=torch.float16 if fp16 else torch.float32 ,#param ["float32", "float16", "bfloat16"]
|
| 69 |
#device='cuda' #'cpu'
|
| 70 |
)
|
| 71 |
#log_gpu_memory()
|