Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,10 +4,9 @@ import json
|
|
4 |
def save_to_json(text1, text2, text3, video, agree):
|
5 |
"""Saves the input text and video to a JSON file if the checkbox is checked."""
|
6 |
if agree:
|
7 |
-
# Save the video to
|
8 |
-
video_filename = "uploaded_video.mp4"
|
9 |
-
|
10 |
-
f.write(video.read())
|
11 |
|
12 |
data = {
|
13 |
"text1": text1,
|
@@ -27,8 +26,8 @@ iface = gr.Interface(
|
|
27 |
gr.TextArea(lines=5, placeholder="Enter text 1 here..."),
|
28 |
gr.TextArea(lines=5, placeholder="Enter text 2 here..."),
|
29 |
gr.TextArea(lines=5, placeholder="Enter text 3 here..."),
|
30 |
-
gr.Video(format="mp4"),
|
31 |
-
gr.Checkbox(label="I agree and have the rights to share
|
32 |
],
|
33 |
outputs="text",
|
34 |
title="Save Text and Video to JSON",
|
|
|
4 |
def save_to_json(text1, text2, text3, video, agree):
|
5 |
"""Saves the input text and video to a JSON file if the checkbox is checked."""
|
6 |
if agree:
|
7 |
+
# Save the video to an mp4 file
|
8 |
+
video_filename = "uploaded_video.mp4"
|
9 |
+
video.save(video_filename)
|
|
|
10 |
|
11 |
data = {
|
12 |
"text1": text1,
|
|
|
26 |
gr.TextArea(lines=5, placeholder="Enter text 1 here..."),
|
27 |
gr.TextArea(lines=5, placeholder="Enter text 2 here..."),
|
28 |
gr.TextArea(lines=5, placeholder="Enter text 3 here..."),
|
29 |
+
gr.Video(format="mp4"),
|
30 |
+
gr.Checkbox(label="I agree and have the rights to share these prompts under the CC-BY license.")
|
31 |
],
|
32 |
outputs="text",
|
33 |
title="Save Text and Video to JSON",
|