Muhammad Anas Akhtar
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
from diffusers import StableDiffusionPipeline
|
4 |
-
|
5 |
|
6 |
# Retrieve the Hugging Face token stored in Hugging Face Spaces secrets
|
7 |
-
HUGGINGFACE_TOKEN =
|
8 |
|
9 |
if not HUGGINGFACE_TOKEN:
|
10 |
-
raise ValueError("Hugging Face token not found! Make sure it's added in
|
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
|