Yaron Koresh commited on
Commit
a67a3c8
·
verified ·
1 Parent(s): 5dbc133

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import gradio as gr
 
2
  #from tempfile import NamedTemporaryFile
3
  import numpy as np
4
  import spaces
@@ -55,7 +56,7 @@ def generate_random_string(length):
55
  @spaces.GPU(duration=20)
56
  def infer(prompt):
57
  name = generate_random_string(12)+".png"
58
- english_prompt = "real fusion from " + translate(prompt,"en")
59
  print(f'Final prompt: {english_prompt}')
60
  image = pipe(english_prompt).images[0].save(name)
61
  return name
 
1
  import gradio as gr
2
+ import re
3
  #from tempfile import NamedTemporaryFile
4
  import numpy as np
5
  import spaces
 
56
  @spaces.GPU(duration=20)
57
  def infer(prompt):
58
  name = generate_random_string(12)+".png"
59
+ english_prompt = "Real & Reasonable Scenario: " + re.sub(f'[{string.punctuation}]', '', re.sub('[\s+]', ' ', translate(prompt,"en"))).upper().strip() + ". Generate that scenario in an authentic form. Use realistic content!"
60
  print(f'Final prompt: {english_prompt}')
61
  image = pipe(english_prompt).images[0].save(name)
62
  return name