Skip to content

Commit

Permalink
Merge pull request #35 from CarperAI/architext-bugfix-11-27
Browse files Browse the repository at this point in the history
Architext process method bugfix
  • Loading branch information
shahbuland committed Dec 8, 2022
2 parents 84008e9 + daade33 commit 14deafb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/architext/architext_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ def __init__(self):
self.device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
self.model = self.model.to(self.device)

def process(self, data: ArchitextBatchElement) -> ArchitextBatchElement:
def process(self, data: 'list[ArchitextBatchElement]') -> ArchitextBatchElement:
data = data[0]
imgs_comb, out_dict = prompt_to_layout(self.model, self.tokenizer, self.device, data.prompt, data.creativity)
data.result = { 'image': imgs_comb, 'layout': out_dict }
return data
return [data]


class ArchitextFront(GradioFront):
Expand Down Expand Up @@ -144,7 +145,7 @@ def present(self, task):
choices = self.space_names_camel_case_to_title_case(space_names),
value = [], visible = False)
else:
rule_string = self.rules[random.randint(0, 6)];
rule_string = self.rules[random.randint(0, 5)]
prompt = gr.update(interactive = False)
creativity = gr.update(interactive = False)
feedback = gr.update(interactive = True, visible = True)
Expand Down

0 comments on commit 14deafb

Please sign in to comment.