Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,11 +71,6 @@ def load_captioning(uploaded_images, concept_sentence):
|
|
| 71 |
updates.append(gr.update(placeholder=f"A {concept_sentence} in a mall"))
|
| 72 |
return updates
|
| 73 |
|
| 74 |
-
|
| 75 |
-
if is_spaces:
|
| 76 |
-
load_captioning = spaces.GPU()(load_captioning)
|
| 77 |
-
|
| 78 |
-
|
| 79 |
def create_dataset(*inputs):
|
| 80 |
print("Creating dataset")
|
| 81 |
images = inputs[0]
|
|
@@ -133,6 +128,8 @@ def run_captioning(images, concept_sentence, *captions):
|
|
| 133 |
del model
|
| 134 |
del processor
|
| 135 |
|
|
|
|
|
|
|
| 136 |
|
| 137 |
def start_training(
|
| 138 |
profile: Union[gr.OAuthProfile, None],
|
|
|
|
| 71 |
updates.append(gr.update(placeholder=f"A {concept_sentence} in a mall"))
|
| 72 |
return updates
|
| 73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
def create_dataset(*inputs):
|
| 75 |
print("Creating dataset")
|
| 76 |
images = inputs[0]
|
|
|
|
| 128 |
del model
|
| 129 |
del processor
|
| 130 |
|
| 131 |
+
if is_spaces:
|
| 132 |
+
load_captioning = spaces.GPU()(run_captioning)
|
| 133 |
|
| 134 |
def start_training(
|
| 135 |
profile: Union[gr.OAuthProfile, None],
|