bgaspra commited on
Commit
acc7002
·
verified ·
1 Parent(s): 0fcbd10

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -8,14 +8,13 @@ from tensorflow.keras.preprocessing import image
8
  from sklearn.neighbors import NearestNeighbors
9
  import joblib
10
  from PIL import UnidentifiedImageError, Image
11
- import matplotlib.pyplot as plt
12
  import gradio as gr
13
 
14
  # Load the dataset
15
  dataset = load_dataset("thefcraft/civitai-stable-diffusion-337k")
16
 
17
  # Take a subset of the dataset
18
- subset_size = 50
19
  dataset_subset = dataset['train'].shuffle(seed=42).select(range(subset_size))
20
 
21
  # Directory to save images
@@ -136,4 +135,5 @@ iface = gr.Interface(
136
  )
137
 
138
  # Launch the Gradio app
139
- iface.launch()
 
 
8
  from sklearn.neighbors import NearestNeighbors
9
  import joblib
10
  from PIL import UnidentifiedImageError, Image
 
11
  import gradio as gr
12
 
13
  # Load the dataset
14
  dataset = load_dataset("thefcraft/civitai-stable-diffusion-337k")
15
 
16
  # Take a subset of the dataset
17
+ subset_size = 1000
18
  dataset_subset = dataset['train'].shuffle(seed=42).select(range(subset_size))
19
 
20
  # Directory to save images
 
135
  )
136
 
137
  # Launch the Gradio app
138
+ if __name__ == "__main__":
139
+ iface.launch()