Spaces:
Running
Running
AbhinavKrishnan36
commited on
Commit
•
bf93081
1
Parent(s):
82673c9
Update app.py
Browse files
app.py
CHANGED
@@ -2,11 +2,11 @@ import gradio as gr
|
|
2 |
import torch
|
3 |
from diffusers import StableDiffusion3Pipeline
|
4 |
import os
|
|
|
|
|
5 |
|
6 |
# Retrieve Hugging Face API key from environment variables
|
7 |
hf_api_key = os.getenv("PRODIGY_GA_02")
|
8 |
-
if hf_api_key is None:
|
9 |
-
raise ValueError("Hugging Face API key 'PRODIGY_GA_02' not found. Ensure it is set as a secret.")
|
10 |
|
11 |
# Load model with authentication token
|
12 |
model_id = "stabilityai/stable-diffusion-3.5-medium"
|
|
|
2 |
import torch
|
3 |
from diffusers import StableDiffusion3Pipeline
|
4 |
import os
|
5 |
+
from huggingface_hub import InferenceApi
|
6 |
+
|
7 |
|
8 |
# Retrieve Hugging Face API key from environment variables
|
9 |
hf_api_key = os.getenv("PRODIGY_GA_02")
|
|
|
|
|
10 |
|
11 |
# Load model with authentication token
|
12 |
model_id = "stabilityai/stable-diffusion-3.5-medium"
|