PR-Puppets commited on
Commit
f2bceec
β€’
1 Parent(s): ae8545d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -30
app.py CHANGED
@@ -214,9 +214,11 @@ def download_video(url, prompt, save_path_text, save_path_video):
214
  css = '''
215
  p, li{font-size: 16px}
216
  code{font-size: 18px}
 
217
  '''
218
  # Create Gradio interface
219
  with gr.Blocks(css=css) as demo:
 
220
  with gr.Tab("Generate with Sora"):
221
  gr.Markdown("# Sora PR Puppets")
222
  gr.Markdown("An artists open letter, click on the 'Why are we doing this' tab to learn more")
@@ -236,35 +238,6 @@ with gr.Blocks(css=css) as demo:
236
  with gr.Accordion("Advanced Options", open=True):
237
  size = gr.Radio(["360p", "480p", "720p", "1080p"], label="Resolution", value="360p", info="Trade off between resolution and speed")
238
  duration = gr.Slider(minimum=5, maximum=10, step=5, label="Duration", value=10)
239
- with gr.Accordion("Generation gallery"):
240
- @gr.render(inputs=[generation_history, list_size])
241
- def show_output_list(generation_history, list_size):
242
- metadata_path = hf_hub_download(
243
- repo_id=repo_id,
244
- filename=f"train/metadata.csv",
245
- repo_type="dataset"
246
- )
247
- existing_metadata = pd.read_csv(metadata_path)
248
- print(existing_metadata)
249
- for index, generation_list in existing_metadata.iloc[-list_size:][::-1].iterrows():
250
- print(generation_list)
251
- generation_prompt = generation_list['prompt']
252
- generation = generation_list['original_url']
253
- #history_list = generation_history.split(',') if generation_history else []
254
- #history_list_latest = history_list[:list_size]
255
- #for generation in history_list_latest:
256
- # generation_prompt_file = generation.replace('.mp4', '.txt')
257
- # with open(generation_prompt_file, 'r') as file:
258
- # generation_prompt = file.read()
259
- with gr.Group():
260
- gr.Markdown(value=f"### {generation_prompt}")
261
- gr.HTML(f'''
262
- <video controls width="100%">
263
- <source src="{generation}" type="video/mp4" />
264
- </video>
265
- ''')
266
- load_more = gr.Button("Load more")
267
- load_more.click(fn=increase_list_size, inputs=list_size, outputs=list_size)
268
  with gr.Tab("Open letter: why are we doing this?"):
269
  gr.Markdown('''# β”Œβˆ©β”(β—£_β—’)β”Œβˆ©β” DEAR CORPORATE AI OVERLORDS β”Œβˆ©β”(β—£_β—’)β”Œβˆ©β”
270
 
@@ -302,7 +275,37 @@ Enjoy,
302
 
303
  some sora-alpha-artists
304
 
305
- ''', elem_id="manifesto")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
  generate_button.click(
307
  fn=generate_video,
308
  inputs=[prompt_input, size, duration, generation_history],
 
214
  css = '''
215
  p, li{font-size: 16px}
216
  code{font-size: 18px}
217
+ #component-1{opacity: 0.5; pointer-events: none}
218
  '''
219
  # Create Gradio interface
220
  with gr.Blocks(css=css) as demo:
221
+ gr.Markdown("# After 3 hours, OpenAI shut down Sora's early access temporarely for all artists.")
222
  with gr.Tab("Generate with Sora"):
223
  gr.Markdown("# Sora PR Puppets")
224
  gr.Markdown("An artists open letter, click on the 'Why are we doing this' tab to learn more")
 
238
  with gr.Accordion("Advanced Options", open=True):
239
  size = gr.Radio(["360p", "480p", "720p", "1080p"], label="Resolution", value="360p", info="Trade off between resolution and speed")
240
  duration = gr.Slider(minimum=5, maximum=10, step=5, label="Duration", value=10)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  with gr.Tab("Open letter: why are we doing this?"):
242
  gr.Markdown('''# β”Œβˆ©β”(β—£_β—’)β”Œβˆ©β” DEAR CORPORATE AI OVERLORDS β”Œβˆ©β”(β—£_β—’)β”Œβˆ©β”
243
 
 
275
 
276
  some sora-alpha-artists
277
 
278
+ ''', elem_id="manifesto")
279
+ with gr.Accordion("Generation gallery", open=True):
280
+ gr.Markdown("Videos generated while the tool was up")
281
+ @gr.render(inputs=[generation_history, list_size])
282
+ def show_output_list(generation_history, list_size):
283
+ metadata_path = hf_hub_download(
284
+ repo_id=repo_id,
285
+ filename=f"train/metadata.csv",
286
+ repo_type="dataset"
287
+ )
288
+ existing_metadata = pd.read_csv(metadata_path)
289
+ print(existing_metadata)
290
+ for index, generation_list in existing_metadata.iloc[-list_size:][::-1].iterrows():
291
+ print(generation_list)
292
+ generation_prompt = generation_list['prompt']
293
+ generation = generation_list['original_url']
294
+ #history_list = generation_history.split(',') if generation_history else []
295
+ #history_list_latest = history_list[:list_size]
296
+ #for generation in history_list_latest:
297
+ # generation_prompt_file = generation.replace('.mp4', '.txt')
298
+ # with open(generation_prompt_file, 'r') as file:
299
+ # generation_prompt = file.read()
300
+ with gr.Group():
301
+ gr.Markdown(value=f"### {generation_prompt}")
302
+ gr.HTML(f'''
303
+ <video controls width="100%">
304
+ <source src="{generation}" type="video/mp4" />
305
+ </video>
306
+ ''')
307
+ load_more = gr.Button("Load more")
308
+ load_more.click(fn=increase_list_size, inputs=list_size, outputs=list_size)
309
  generate_button.click(
310
  fn=generate_video,
311
  inputs=[prompt_input, size, duration, generation_history],