Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -22,6 +22,19 @@ from flux.util import (configs, embed_watermark, load_ae, load_clip, load_flow_m
|
|
22 |
from huggingface_hub import login
|
23 |
login(token=os.getenv('Token'))
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
@dataclass
|
26 |
class SamplingOptions:
|
27 |
source_prompt: str
|
|
|
22 |
from huggingface_hub import login
|
23 |
login(token=os.getenv('Token'))
|
24 |
|
25 |
+
|
26 |
+
import torch
|
27 |
+
|
28 |
+
device = torch.cuda.current_device()
|
29 |
+
total_memory = torch.cuda.get_device_properties(device).total_memory
|
30 |
+
allocated_memory = torch.cuda.memory_allocated(device)
|
31 |
+
reserved_memory = torch.cuda.memory_reserved(device)
|
32 |
+
|
33 |
+
print(f"Total memory: {total_memory / 1024**2:.2f} MB")
|
34 |
+
print(f"Allocated memory: {allocated_memory / 1024**2:.2f} MB")
|
35 |
+
print(f"Reserved memory: {reserved_memory / 1024**2:.2f} MB")
|
36 |
+
|
37 |
+
|
38 |
@dataclass
|
39 |
class SamplingOptions:
|
40 |
source_prompt: str
|