Spaces:
Runtime error
Runtime error
Commit
·
6a49dc6
1
Parent(s):
7a7d572
Changes
Browse files
app.py
CHANGED
|
@@ -8,14 +8,17 @@ from diffusers import StableDiffusionPipeline, DDIMScheduler, DiffusionPipeline
|
|
| 8 |
import streamlit as st
|
| 9 |
|
| 10 |
from huggingface_hub import login
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
# model_path = WEIGHTS_DIR # If you want to use previously trained model saved in gdrive, replace this with the full path of model in gdrive
|
| 15 |
# headers = {"Authorization": "Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
|
| 16 |
-
# pipe = StableDiffusionPipeline.from_pretrained("Divyanshu04/Finetuned-sd-vae", safety_checker=None, torch_dtype=torch.float32).to("cuda")
|
| 17 |
|
| 18 |
-
pipe = StableDiffusionPipeline.from_pretrained("Divyanshu04/Finetuned-model", torch_dtype=torch.
|
|
|
|
| 19 |
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
|
| 20 |
pipe.enable_xformers_memory_efficient_attention()
|
| 21 |
g_cuda = None
|
|
|
|
| 8 |
import streamlit as st
|
| 9 |
|
| 10 |
from huggingface_hub import login
|
| 11 |
+
|
| 12 |
+
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 13 |
+
|
| 14 |
+
login(token = HF_TOKEN)
|
| 15 |
|
| 16 |
|
| 17 |
# model_path = WEIGHTS_DIR # If you want to use previously trained model saved in gdrive, replace this with the full path of model in gdrive
|
| 18 |
# headers = {"Authorization": "Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
|
|
|
|
| 19 |
|
| 20 |
+
pipe = StableDiffusionPipeline.from_pretrained("Divyanshu04/Finetuned-model", safety_checker=None, torch_dtype=torch.float32).to("cuda")
|
| 21 |
+
|
| 22 |
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
|
| 23 |
pipe.enable_xformers_memory_efficient_attention()
|
| 24 |
g_cuda = None
|