Kohaku-Blueleaf commited on
Commit
0d5bdc3
1 Parent(s): 4f72b76

specific possible duration to avoid out of quota

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -19,7 +19,7 @@ import torch
19
  from transformers import set_seed
20
  if sys.platform == "win32":
21
  #dev env in windows, @spaces.GPU will cause problem
22
- def GPU(func):
23
  return func
24
  else:
25
  from spaces import GPU
@@ -85,7 +85,7 @@ def format_time(timing):
85
  return result
86
 
87
 
88
- @GPU
89
  @torch.no_grad()
90
  def generate(
91
  tags,
@@ -136,7 +136,7 @@ def generate(
136
  yield result, input_prompt, format_time(timing)
137
 
138
 
139
- @GPU
140
  @torch.no_grad()
141
  def generate_image(
142
  seed,
 
19
  from transformers import set_seed
20
  if sys.platform == "win32":
21
  #dev env in windows, @spaces.GPU will cause problem
22
+ def GPU(func, *args, **kwargs):
23
  return func
24
  else:
25
  from spaces import GPU
 
85
  return result
86
 
87
 
88
+ @GPU(duration=10)
89
  @torch.no_grad()
90
  def generate(
91
  tags,
 
136
  yield result, input_prompt, format_time(timing)
137
 
138
 
139
+ @GPU(duration=20)
140
  @torch.no_grad()
141
  def generate_image(
142
  seed,