Muhammad Anas Akhtar commited on
Commit
a6709d2
·
verified ·
1 Parent(s): 07d15c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,13 +1,13 @@
1
  import gradio as gr
2
  import torch
3
  from diffusers import StableDiffusionPipeline
4
- from huggingface_hub import hf_api
5
 
6
  # Retrieve the Hugging Face token stored in Hugging Face Spaces secrets
7
- HUGGINGFACE_TOKEN = hf_api.get_secret("keyss")
8
 
9
  if not HUGGINGFACE_TOKEN:
10
- raise ValueError("Hugging Face token not found! Make sure it's added in the Hugging Face Secrets.")
11
 
12
  def image_generation(prompt):
13
  # Check if GPU is available
 
1
  import gradio as gr
2
  import torch
3
  from diffusers import StableDiffusionPipeline
4
+ import os
5
 
6
  # Retrieve the Hugging Face token stored in Hugging Face Spaces secrets
7
+ HUGGINGFACE_TOKEN = os.getenv("keyss")
8
 
9
  if not HUGGINGFACE_TOKEN:
10
+ raise ValueError("Hugging Face token not found! Make sure it's added in Hugging Face Secrets.")
11
 
12
  def image_generation(prompt):
13
  # Check if GPU is available