Nick088 commited on
Commit
359047c
1 Parent(s): 2330a16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -37,7 +37,7 @@ model = T5ForConditionalGeneration.from_pretrained("roborovski/superprompt-v1",
37
  model.to(device)
38
 
39
  # Define the image generation function
40
- @spaces.GPU(duration=60)
41
  def generate_image(prompt, enhance_prompt, negative_prompt, num_inference_steps, height, width, guidance_scale, seed, num_images_per_prompt):
42
  if seed == 0:
43
  seed = random.randint(1, 2**32-1)
@@ -55,8 +55,9 @@ def generate_image(prompt, enhance_prompt, negative_prompt, num_inference_steps,
55
  do_sample=True,
56
  temperature=0.7,
57
  top_p=1,
58
- top_k=50,
59
- )
 
60
 
61
  generator = torch.Generator().manual_seed(seed)
62
 
 
37
  model.to(device)
38
 
39
  # Define the image generation function
40
+ @spaces.GPU(duration=60 * 2)
41
  def generate_image(prompt, enhance_prompt, negative_prompt, num_inference_steps, height, width, guidance_scale, seed, num_images_per_prompt):
42
  if seed == 0:
43
  seed = random.randint(1, 2**32-1)
 
55
  do_sample=True,
56
  temperature=0.7,
57
  top_p=1,
58
+ top_k=50
59
+ )
60
+ prompt = tokenizer.decode(outputs[0], skip_special_tokens=True)
61
 
62
  generator = torch.Generator().manual_seed(seed)
63