Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -7,8 +7,9 @@ from datasets import load_dataset
|
|
7 |
from huggingface_hub import Repository
|
8 |
from huggingface_hub import HfApi, HfFolder, Repository, create_repo
|
9 |
import os
|
10 |
-
|
11 |
-
|
|
|
12 |
import gradio as gr
|
13 |
from PIL import Image
|
14 |
import os
|
@@ -23,7 +24,7 @@ big = False if device == torch.device('cpu') else True
|
|
23 |
|
24 |
# Parameters
|
25 |
IMG_SIZE = 1024 if big else 256
|
26 |
-
BATCH_SIZE = 16 if big else
|
27 |
EPOCHS = 12
|
28 |
LR = 0.0002
|
29 |
dataset_id = "K00B404/pix2pix_flux_set"
|
@@ -62,7 +63,7 @@ class UNetWrapper:
|
|
62 |
def __init__(self, unet_model, repo_id):
|
63 |
self.model = unet_model
|
64 |
self.repo_id = repo_id
|
65 |
-
self.token =
|
66 |
self.api = HfApi()
|
67 |
|
68 |
def push_to_hub(self):
|
|
|
7 |
from huggingface_hub import Repository
|
8 |
from huggingface_hub import HfApi, HfFolder, Repository, create_repo
|
9 |
import os
|
10 |
+
|
11 |
+
token = os.getenv('NEW_TOKEN')
|
12 |
+
|
13 |
import gradio as gr
|
14 |
from PIL import Image
|
15 |
import os
|
|
|
24 |
|
25 |
# Parameters
|
26 |
IMG_SIZE = 1024 if big else 256
|
27 |
+
BATCH_SIZE = 16 if big else 4
|
28 |
EPOCHS = 12
|
29 |
LR = 0.0002
|
30 |
dataset_id = "K00B404/pix2pix_flux_set"
|
|
|
63 |
def __init__(self, unet_model, repo_id):
|
64 |
self.model = unet_model
|
65 |
self.repo_id = repo_id
|
66 |
+
self.token = os.getenv('NEW_TOKEN') # Make sure this environment variable is set
|
67 |
self.api = HfApi()
|
68 |
|
69 |
def push_to_hub(self):
|