Spaces:
Running
Running
Create app.py
Browse files
app.py
CHANGED
|
@@ -8,8 +8,7 @@ from transformers import (
|
|
| 8 |
)
|
| 9 |
|
| 10 |
import gradio as gr
|
| 11 |
-
|
| 12 |
-
# import spaces # ZERO GPU
|
| 13 |
|
| 14 |
|
| 15 |
MODEL_NAMES = ["p1atdev/wd-swinv2-tagger-v3-hf"]
|
|
@@ -90,7 +89,7 @@ def animagine_prompt(rating: list[str], character: list[str], general: list[str]
|
|
| 90 |
return ", ".join(all_tags)
|
| 91 |
|
| 92 |
|
| 93 |
-
|
| 94 |
@torch.no_grad()
|
| 95 |
def predict_tags(
|
| 96 |
image: Image.Image, general_threshold: float = 0.3, character_threshold: float = 0.8
|
|
|
|
| 8 |
)
|
| 9 |
|
| 10 |
import gradio as gr
|
| 11 |
+
import spaces # ZERO GPU
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
MODEL_NAMES = ["p1atdev/wd-swinv2-tagger-v3-hf"]
|
|
|
|
| 89 |
return ", ".join(all_tags)
|
| 90 |
|
| 91 |
|
| 92 |
+
@spaces.GPU
|
| 93 |
@torch.no_grad()
|
| 94 |
def predict_tags(
|
| 95 |
image: Image.Image, general_threshold: float = 0.3, character_threshold: float = 0.8
|