Notebook login add
Browse files
app.py
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import numpy as np
|
| 3 |
import random
|
| 4 |
# import spaces #[uncomment to use ZeroGPU]
|
| 5 |
from diffusers import AutoPipelineForText2Image
|
| 6 |
import torch
|
|
|
|
| 7 |
|
|
|
|
| 8 |
|
| 9 |
-
# from huggingface_hub import notebook_login
|
| 10 |
-
# notebook_login()
|
| 11 |
-
|
| 12 |
-
from huggingface_hub import snapshot_download
|
| 13 |
snapshot_download(repo_id="Roomie/xavyy", cache_dir='./')
|
| 14 |
|
| 15 |
pipeline = AutoPipelineForText2Image.from_pretrained(
|
|
@@ -23,7 +22,7 @@ MAX_IMAGE_SIZE = 1024
|
|
| 23 |
# @spaces.GPU #[uncomment to use ZeroGPU]
|
| 24 |
|
| 25 |
|
| 26 |
-
def infer(prompt,
|
| 27 |
|
| 28 |
if randomize_seed:
|
| 29 |
seed = random.randint(0, MAX_SEED)
|
|
|
|
| 1 |
+
from huggingface_hub import snapshot_download
|
| 2 |
import gradio as gr
|
| 3 |
import numpy as np
|
| 4 |
import random
|
| 5 |
# import spaces #[uncomment to use ZeroGPU]
|
| 6 |
from diffusers import AutoPipelineForText2Image
|
| 7 |
import torch
|
| 8 |
+
from huggingface_hub import notebook_login
|
| 9 |
|
| 10 |
+
notebook_login()
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
snapshot_download(repo_id="Roomie/xavyy", cache_dir='./')
|
| 13 |
|
| 14 |
pipeline = AutoPipelineForText2Image.from_pretrained(
|
|
|
|
| 22 |
# @spaces.GPU #[uncomment to use ZeroGPU]
|
| 23 |
|
| 24 |
|
| 25 |
+
def infer(prompt, seed, randomize_seed):
|
| 26 |
|
| 27 |
if randomize_seed:
|
| 28 |
seed = random.randint(0, MAX_SEED)
|