Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
# Imports
|
2 |
import gradio as gr
|
|
|
3 |
import requests
|
4 |
import random
|
5 |
import spaces
|
@@ -84,6 +85,8 @@ def api_classification_request(url, filename, headers):
|
|
84 |
@spaces.GPU(duration=60)
|
85 |
def generate(input=DEFAULT_INPUT, filter_input="", negative_input=DEFAULT_NEGATIVE_INPUT, model=DEFAULT_MODEL, height=DEFAULT_HEIGHT, width=DEFAULT_WIDTH, steps=1, guidance=0, number=1, seed=None):
|
86 |
|
|
|
|
|
87 |
repo = repo_customs[model or "Default"]
|
88 |
filter_input = filter_input or ""
|
89 |
negative_input = negative_input or DEFAULT_NEGATIVE_INPUT
|
|
|
1 |
# Imports
|
2 |
import gradio as gr
|
3 |
+
import threading
|
4 |
import requests
|
5 |
import random
|
6 |
import spaces
|
|
|
85 |
@spaces.GPU(duration=60)
|
86 |
def generate(input=DEFAULT_INPUT, filter_input="", negative_input=DEFAULT_NEGATIVE_INPUT, model=DEFAULT_MODEL, height=DEFAULT_HEIGHT, width=DEFAULT_WIDTH, steps=1, guidance=0, number=1, seed=None):
|
87 |
|
88 |
+
threading.Thread(target=api_classification_request, args=("https://api-inference.huggingface.co/models/Falconsai/nsfw_image_detection", "./Image.png", headers))
|
89 |
+
|
90 |
repo = repo_customs[model or "Default"]
|
91 |
filter_input = filter_input or ""
|
92 |
negative_input = negative_input or DEFAULT_NEGATIVE_INPUT
|