Spaces:
Runtime error
Runtime error
Update min_dalle/min_dalle.py
Browse files- min_dalle/min_dalle.py +4 -0
min_dalle/min_dalle.py
CHANGED
|
@@ -10,6 +10,7 @@ from typing import Iterator
|
|
| 10 |
from .text_tokenizer import TextTokenizer
|
| 11 |
from .models import DalleBartEncoder, DalleBartDecoder, VQGanDetokenizer
|
| 12 |
import streamlit as st
|
|
|
|
| 13 |
|
| 14 |
torch.set_grad_enabled(False)
|
| 15 |
torch.set_num_threads(os.cpu_count())
|
|
@@ -240,6 +241,9 @@ class MinDalle:
|
|
| 240 |
st.session_state.bar.progress(i/IMAGE_TOKEN_COUNT)
|
| 241 |
|
| 242 |
torch.cuda.empty_cache()
|
|
|
|
|
|
|
|
|
|
| 243 |
with torch.cuda.amp.autocast(dtype=self.dtype):
|
| 244 |
image_tokens[i + 1], attention_state = self.decoder.forward(
|
| 245 |
settings=settings,
|
|
|
|
| 10 |
from .text_tokenizer import TextTokenizer
|
| 11 |
from .models import DalleBartEncoder, DalleBartDecoder, VQGanDetokenizer
|
| 12 |
import streamlit as st
|
| 13 |
+
import time
|
| 14 |
|
| 15 |
torch.set_grad_enabled(False)
|
| 16 |
torch.set_num_threads(os.cpu_count())
|
|
|
|
| 241 |
st.session_state.bar.progress(i/IMAGE_TOKEN_COUNT)
|
| 242 |
|
| 243 |
torch.cuda.empty_cache()
|
| 244 |
+
|
| 245 |
+
time.sleep(0.5)
|
| 246 |
+
|
| 247 |
with torch.cuda.amp.autocast(dtype=self.dtype):
|
| 248 |
image_tokens[i + 1], attention_state = self.decoder.forward(
|
| 249 |
settings=settings,
|