Spaces:
Runtime error
Runtime error
Update inferencer.py
Browse files- inferencer.py +4 -4
inferencer.py
CHANGED
|
@@ -121,7 +121,7 @@ class Inferencer:
|
|
| 121 |
model.eval()
|
| 122 |
return model
|
| 123 |
|
| 124 |
-
@spaces.GPU
|
| 125 |
def gen_image(
|
| 126 |
self,
|
| 127 |
raw_prompt,
|
|
@@ -166,7 +166,7 @@ class Inferencer:
|
|
| 166 |
|
| 167 |
return [Image.fromarray(img) for img in images[0]]
|
| 168 |
|
| 169 |
-
@spaces.GPU
|
| 170 |
def query_image(self, img: Image.Image, prompt=""):
|
| 171 |
model = self.model
|
| 172 |
if not model:
|
|
@@ -217,7 +217,7 @@ class Inferencer:
|
|
| 217 |
# print(tokenizer.decode(output[0]))
|
| 218 |
return tokenizer.decode(output[0])
|
| 219 |
|
| 220 |
-
@spaces.GPU
|
| 221 |
def edit_image(
|
| 222 |
self,
|
| 223 |
source_image: Image.Image,
|
|
@@ -331,7 +331,7 @@ class Inferencer:
|
|
| 331 |
|
| 332 |
return [ Image.fromarray(out) ]
|
| 333 |
|
| 334 |
-
@spaces.GPU
|
| 335 |
def query_text(self, prompt=""):
|
| 336 |
model = self.model
|
| 337 |
if not model:
|
|
|
|
| 121 |
model.eval()
|
| 122 |
return model
|
| 123 |
|
| 124 |
+
@spaces.GPU(duration=120)
|
| 125 |
def gen_image(
|
| 126 |
self,
|
| 127 |
raw_prompt,
|
|
|
|
| 166 |
|
| 167 |
return [Image.fromarray(img) for img in images[0]]
|
| 168 |
|
| 169 |
+
@spaces.GPU(duration=120)
|
| 170 |
def query_image(self, img: Image.Image, prompt=""):
|
| 171 |
model = self.model
|
| 172 |
if not model:
|
|
|
|
| 217 |
# print(tokenizer.decode(output[0]))
|
| 218 |
return tokenizer.decode(output[0])
|
| 219 |
|
| 220 |
+
@spaces.GPU(duration=120)
|
| 221 |
def edit_image(
|
| 222 |
self,
|
| 223 |
source_image: Image.Image,
|
|
|
|
| 331 |
|
| 332 |
return [ Image.fromarray(out) ]
|
| 333 |
|
| 334 |
+
@spaces.GPU(duration=120)
|
| 335 |
def query_text(self, prompt=""):
|
| 336 |
model = self.model
|
| 337 |
if not model:
|