Spaces:
Sleeping
Sleeping
Commit
·
75bf27f
1
Parent(s):
8efd006
gpu request tryout
Browse files
app.py
CHANGED
@@ -230,6 +230,7 @@ def run_inference(word, image, mapping):
|
|
230 |
)
|
231 |
|
232 |
# Start generation in a separate thread with torch.no_grad()
|
|
|
233 |
def generate_with_no_grad():
|
234 |
with torch.no_grad():
|
235 |
model.generate(**generation_kwargs)
|
@@ -331,10 +332,5 @@ with gr.Blocks() as demo:
|
|
331 |
[run_button, loading_indicator, word_input, submit_button, encoded_word_display],
|
332 |
)
|
333 |
|
334 |
-
|
335 |
-
@spaces.GPU
|
336 |
-
def main():
|
337 |
-
demo.launch()
|
338 |
-
|
339 |
if __name__ == "__main__":
|
340 |
-
|
|
|
230 |
)
|
231 |
|
232 |
# Start generation in a separate thread with torch.no_grad()
|
233 |
+
@spaces.GPU
|
234 |
def generate_with_no_grad():
|
235 |
with torch.no_grad():
|
236 |
model.generate(**generation_kwargs)
|
|
|
332 |
[run_button, loading_indicator, word_input, submit_button, encoded_word_display],
|
333 |
)
|
334 |
|
|
|
|
|
|
|
|
|
|
|
335 |
if __name__ == "__main__":
|
336 |
+
demo.launch()
|