Browse Source

change version

pull/2/head
oriBetelgeuse 5 years ago
parent
commit
8a9dbc4505
4 changed files with 6 additions and 4 deletions
  1. +1
    -2
      rudalle/__init__.py
  2. +1
    -0
      rudalle/image_prompts.py
  3. +1
    -1
      rudalle/pipelines.py
  4. +3
    -1
      tests/test_image_prompts.py

+ 1
- 2
rudalle/__init__.py View File

@ -22,5 +22,4 @@ __all__ = [
'image_prompts',
]
__version__ = '0.0.1-rc1'
__version__ = '0.0.1-rc2'

+ 1
- 0
rudalle/image_prompts.py View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import torch
import numpy as np


+ 1
- 1
rudalle/pipelines.py View File

@ -37,7 +37,7 @@ def generate_images(text, tokenizer, dalle, vae, top_k, top_p, images_num, image
prompts = prompts.repeat(images_num, 1)
if use_cache:
use_cache = False
print("Warning: use_cache changed to False")
print('Warning: use_cache changed to False')
for idx in tqdm(range(out.shape[1], total_seq_length)):
idx -= text_seq_length
if image_prompts is not None and idx in prompts_idx:


+ 3
- 1
tests/test_image_prompts.py View File

@ -1,7 +1,9 @@
# -*- coding: utf-8 -*-
import pytest
from rudalle.image_prompts import ImagePrompts
@pytest.mark.parametrize('borders, crop_first', [
({'up': 4, 'right': 0, 'left': 0, 'down': 0}, False),
({'up': 4, 'right': 0, 'left': 0, 'down': 0}, True),
@ -17,4 +19,4 @@ def test_image_prompts(sample_image, vae, borders, crop_first):
else:
assert image_prompt.image_prompts.shape[1] == 32 * 32
assert len(image_prompt.image_prompts_idx) == (borders['up'] + borders['down']) * 32 \
+ (borders['left'] + borders['right']) * (32 - borders['up'] - borders['down'])
+ (borders['left'] + borders['right']) * (32 - borders['up'] - borders['down'])

Loading…
Cancel
Save