Yaron Koresh commited on
Commit
01b8e1f
verified
1 Parent(s): 2add16d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -83,15 +83,15 @@ def generate_random_string(length):
83
  characters = string.ascii_letters + string.digits
84
  return ''.join(random.choice(characters) for _ in range(length))
85
 
86
- @spaces.GPU(duration=40)
87
  def Piper(_do,_dont):
88
  return pipe(
89
  _do,
90
- height=320,
91
- width=640,
92
  negative_prompt=_dont,
93
  num_inference_steps=100,
94
- guidance_scale=4
95
  )
96
 
97
  def infer(prompt_en,prompt2_en):
@@ -128,7 +128,7 @@ footer {
128
  max-width: 15cm !important;
129
  }
130
  .image-container {
131
- aspect-ratio: 640 / 320 !important;
132
  }
133
  .dropdown-arrow {
134
  display: none !important;
@@ -143,15 +143,15 @@ function custom(){
143
  """
144
 
145
  if torch.cuda.is_available():
146
- power_device = "诪注讘讚 讙专驻讬"
147
  else:
148
- power_device = "诪注讘讚 诇讜讙讬"
149
 
150
  with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
151
  result = []
152
  with gr.Column(elem_id="col-container"):
153
  gr.Markdown(f"""
154
- # 诪讞讜诇诇 转诪讜谞讜转 - {power_device}
155
  """)
156
  with gr.Row():
157
  prompt = gr.Textbox(
@@ -170,11 +170,11 @@ with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
170
  max_lines=1
171
  )
172
  with gr.Row():
173
- run_button = gr.Button("讛转讞诇讛")
174
  with gr.Row():
175
  result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
176
- result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
177
- result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
178
 
179
  def _ret(idx,p1,p2):
180
  print(f'Starting {idx}: {p1} {p2}')
 
83
  characters = string.ascii_letters + string.digits
84
  return ''.join(random.choice(characters) for _ in range(length))
85
 
86
+ @spaces.GPU(duration=120)
87
  def Piper(_do,_dont):
88
  return pipe(
89
  _do,
90
+ height=1024,
91
+ width=2048,
92
  negative_prompt=_dont,
93
  num_inference_steps=100,
94
+ guidance_scale=10
95
  )
96
 
97
  def infer(prompt_en,prompt2_en):
 
128
  max-width: 15cm !important;
129
  }
130
  .image-container {
131
+ aspect-ratio: 2048 / 1024 !important;
132
  }
133
  .dropdown-arrow {
134
  display: none !important;
 
143
  """
144
 
145
  if torch.cuda.is_available():
146
+ power_device = "GPU"
147
  else:
148
+ power_device = "CPU"
149
 
150
  with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
151
  result = []
152
  with gr.Column(elem_id="col-container"):
153
  gr.Markdown(f"""
154
+ # 诪讞讜诇诇 转诪讜谞讜转 {power_device}
155
  """)
156
  with gr.Row():
157
  prompt = gr.Textbox(
 
170
  max_lines=1
171
  )
172
  with gr.Row():
173
+ run_button = gr.Button("讛转讞诇讛",scale=0)
174
  with gr.Row():
175
  result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
176
+ #result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
177
+ #result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
178
 
179
  def _ret(idx,p1,p2):
180
  print(f'Starting {idx}: {p1} {p2}')