Spaces:
Sleeping
Sleeping
app.py
CHANGED
@@ -247,17 +247,17 @@ def sample_ddpm_context(n_sample,timesteps, context, save_rate=20):
|
|
247 |
|
248 |
def greet(input):
|
249 |
steps = int(input)
|
250 |
-
|
251 |
#ctx = F.one_hot(torch.randint(0, 5, (32,)), 5).to(device=device).float()
|
252 |
|
253 |
# hero, non-hero, food, spell, side-facing
|
254 |
one_hot_enc = np.array([1, 0, 0, 0, 0])
|
255 |
-
shape = (
|
256 |
mtx_2d = np.ones(shape) * one_hot_enc
|
257 |
ctx = torch.from_numpy(mtx_2d).to(device=device).float()
|
258 |
|
259 |
#samples, intermediate = sample_ddim_context(32, ctx, n=steps)
|
260 |
-
|
261 |
samples, intermediate = sample_ddpm_context(image_count, steps, ctx)
|
262 |
|
263 |
#samples, intermediate = sample_ddim(32, n=steps)
|
|
|
247 |
|
248 |
def greet(input):
|
249 |
steps = int(input)
|
250 |
+
image_count = 1;
|
251 |
#ctx = F.one_hot(torch.randint(0, 5, (32,)), 5).to(device=device).float()
|
252 |
|
253 |
# hero, non-hero, food, spell, side-facing
|
254 |
one_hot_enc = np.array([1, 0, 0, 0, 0])
|
255 |
+
shape = (image_count, 5)
|
256 |
mtx_2d = np.ones(shape) * one_hot_enc
|
257 |
ctx = torch.from_numpy(mtx_2d).to(device=device).float()
|
258 |
|
259 |
#samples, intermediate = sample_ddim_context(32, ctx, n=steps)
|
260 |
+
|
261 |
samples, intermediate = sample_ddpm_context(image_count, steps, ctx)
|
262 |
|
263 |
#samples, intermediate = sample_ddim(32, n=steps)
|