Moved model to gpu before calling count functions
Browse files
app.py
CHANGED
|
@@ -222,6 +222,8 @@ def get_ind_to_filter(text, word_ids, keywords):
|
|
| 222 |
|
| 223 |
@spaces.GPU
|
| 224 |
def count(image, text, prompts, state, device):
|
|
|
|
|
|
|
| 225 |
|
| 226 |
keywords = "" # do not handle this for now
|
| 227 |
|
|
@@ -314,6 +316,8 @@ def count(image, text, prompts, state, device):
|
|
| 314 |
|
| 315 |
@spaces.GPU
|
| 316 |
def count_main(image, text, prompts, device):
|
|
|
|
|
|
|
| 317 |
keywords = "" # do not handle this for now
|
| 318 |
# Handle no prompt case.
|
| 319 |
if prompts is None:
|
|
|
|
| 222 |
|
| 223 |
@spaces.GPU
|
| 224 |
def count(image, text, prompts, state, device):
|
| 225 |
+
|
| 226 |
+
model.to(device)
|
| 227 |
|
| 228 |
keywords = "" # do not handle this for now
|
| 229 |
|
|
|
|
| 316 |
|
| 317 |
@spaces.GPU
|
| 318 |
def count_main(image, text, prompts, device):
|
| 319 |
+
model.to(device)
|
| 320 |
+
|
| 321 |
keywords = "" # do not handle this for now
|
| 322 |
# Handle no prompt case.
|
| 323 |
if prompts is None:
|