multimodalart HF Staff commited on
Commit
e44b249
·
verified ·
1 Parent(s): 62c6ea1

[Admin maintenance] Support new ZeroGPU hardware

Browse files

Thank you so much for having shared this Space with the community on this demo. We have upgraded the ZeroGPU infra-structure to run on modern blackwell architecture.
For that, we need to upgrade your demo to support that. This PR fixes your demo to work with the new architecture. As this is something we broke on our end, we may merge this PR autonomously. If this breaks unexpectedly or brings unintended consequences, feel free to revert, modify or otherwise. Any issues you can email apolinario@huggingface.co

Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -1,9 +1,17 @@
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
  import torch
3
  from PIL import Image
4
  from diffusers import DiffusionPipeline
5
  import os
6
- import spaces
7
 
8
  # Constants
9
  #SAFETY_CHECKER = os.environ.get("SAFETY_CHECKER", "0") == "1"
@@ -31,8 +39,6 @@ def generate_image(prompt, num_inference_steps=50, guidance_scale=7):
31
 
32
  return results.images[0]
33
 
34
- import gradio as gr
35
-
36
  # Gradio Interface
37
  description = """
38
  This demo utilizes the playgroundai/playground-v2.5-1024px-aesthetic by Playground, which is a text-to-image generative model capable of producing high-quality images.
@@ -64,4 +70,4 @@ with gr.Blocks() as demo:
64
  outputs=img,
65
  )
66
 
67
- demo.queue().launch()
 
1
+ import huggingface_hub
2
+ if not hasattr(huggingface_hub, "HfFolder"):
3
+ class HfFolder:
4
+ @staticmethod
5
+ def get_token():
6
+ return huggingface_hub.get_token()
7
+ huggingface_hub.HfFolder = HfFolder
8
+
9
+ import spaces
10
  import gradio as gr
11
  import torch
12
  from PIL import Image
13
  from diffusers import DiffusionPipeline
14
  import os
 
15
 
16
  # Constants
17
  #SAFETY_CHECKER = os.environ.get("SAFETY_CHECKER", "0") == "1"
 
39
 
40
  return results.images[0]
41
 
 
 
42
  # Gradio Interface
43
  description = """
44
  This demo utilizes the playgroundai/playground-v2.5-1024px-aesthetic by Playground, which is a text-to-image generative model capable of producing high-quality images.
 
70
  outputs=img,
71
  )
72
 
73
+ demo.queue().launch()