Update inferencer.py
Browse files- inferencer.py +4 -0
inferencer.py
CHANGED
@@ -122,6 +122,7 @@ class Inferencer:
|
|
122 |
model.eval()
|
123 |
return model
|
124 |
|
|
|
125 |
def gen_image(
|
126 |
self,
|
127 |
raw_prompt,
|
@@ -164,6 +165,7 @@ class Inferencer:
|
|
164 |
|
165 |
return [Image.fromarray(img) for img in images[0]]
|
166 |
|
|
|
167 |
def query_image(self, img: Image.Image, prompt=""):
|
168 |
model = self.model
|
169 |
tokenizer = model.tokenizer
|
@@ -349,6 +351,7 @@ class Inferencer:
|
|
349 |
# )
|
350 |
# return [output_image]
|
351 |
|
|
|
352 |
def edit_image(
|
353 |
self,
|
354 |
source_image: Image.Image,
|
@@ -460,6 +463,7 @@ class Inferencer:
|
|
460 |
|
461 |
return [ Image.fromarray(out) ]
|
462 |
|
|
|
463 |
def query_text(self, prompt=""):
|
464 |
model = self.model
|
465 |
tokenizer = model.tokenizer
|
|
|
122 |
model.eval()
|
123 |
return model
|
124 |
|
125 |
+
@spaces.GPU
|
126 |
def gen_image(
|
127 |
self,
|
128 |
raw_prompt,
|
|
|
165 |
|
166 |
return [Image.fromarray(img) for img in images[0]]
|
167 |
|
168 |
+
@spaces.GPU
|
169 |
def query_image(self, img: Image.Image, prompt=""):
|
170 |
model = self.model
|
171 |
tokenizer = model.tokenizer
|
|
|
351 |
# )
|
352 |
# return [output_image]
|
353 |
|
354 |
+
@spaces.GPU
|
355 |
def edit_image(
|
356 |
self,
|
357 |
source_image: Image.Image,
|
|
|
463 |
|
464 |
return [ Image.fromarray(out) ]
|
465 |
|
466 |
+
@spaces.GPU
|
467 |
def query_text(self, prompt=""):
|
468 |
model = self.model
|
469 |
tokenizer = model.tokenizer
|