appsnprojectsstpl-tech commited on
Commit ·
7f04a79
1
Parent(s): 09487cb
Fix ZeroGPU supervisor shutdown
Browse files- app.py +2 -0
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
|
|
|
| 3 |
|
|
|
|
| 4 |
def generate_image(prompt, hf_token, progress=gr.Progress(track_tqdm=True)):
|
| 5 |
if not hf_token:
|
| 6 |
raise gr.Error("Please enter your Hugging Face API Token!")
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
+
import spaces
|
| 4 |
|
| 5 |
+
@spaces.GPU
|
| 6 |
def generate_image(prompt, hf_token, progress=gr.Progress(track_tqdm=True)):
|
| 7 |
if not hf_token:
|
| 8 |
raise gr.Error("Please enter your Hugging Face API Token!")
|
requirements.txt
CHANGED
|
@@ -1,2 +1,3 @@
|
|
| 1 |
gradio
|
| 2 |
-
huggingface_hub
|
|
|
|
|
|
| 1 |
gradio
|
| 2 |
+
huggingface_hub
|
| 3 |
+
spaces
|