Archenar
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,8 @@ from tempfile import _TemporaryFileWrapper
|
|
7 |
|
8 |
# Check Runtime to avoid Error
|
9 |
globalopt = []
|
10 |
-
|
|
|
11 |
globalopt = ["-y", "-hide_banner", "-threads 64", "-filter_threads 64", "-filter_complex_threads 64"]
|
12 |
else:
|
13 |
globalopt = ["-y", "-hide_banner", "-hwaccel cuda", "-threads 64", "-filter_threads 64", "-filter_complex_threads 64"]
|
@@ -46,7 +47,7 @@ def cmdb_fb(a, b, c):
|
|
46 |
# print(tuning)
|
47 |
return f"-filter:v \"tblend\" -r {a} -preset {b} -tune {tuning}"
|
48 |
|
49 |
-
with gr.Blocks() as main:
|
50 |
with gr.Tabs():
|
51 |
with gr.TabItem("Main"):
|
52 |
with gr.Row():
|
@@ -93,4 +94,7 @@ with gr.Blocks() as main:
|
|
93 |
|
94 |
# Launch the combined interface
|
95 |
if __name__ == "__main__":
|
96 |
-
|
|
|
|
|
|
|
|
7 |
|
8 |
# Check Runtime to avoid Error
|
9 |
globalopt = []
|
10 |
+
limit = os.getenv("SYSTEM") == "spaces"
|
11 |
+
if limit:
|
12 |
globalopt = ["-y", "-hide_banner", "-threads 64", "-filter_threads 64", "-filter_complex_threads 64"]
|
13 |
else:
|
14 |
globalopt = ["-y", "-hide_banner", "-hwaccel cuda", "-threads 64", "-filter_threads 64", "-filter_complex_threads 64"]
|
|
|
47 |
# print(tuning)
|
48 |
return f"-filter:v \"tblend\" -r {a} -preset {b} -tune {tuning}"
|
49 |
|
50 |
+
with gr.Blocks(title="FFmo - FFmpeg Online") as main:
|
51 |
with gr.Tabs():
|
52 |
with gr.TabItem("Main"):
|
53 |
with gr.Row():
|
|
|
94 |
|
95 |
# Launch the combined interface
|
96 |
if __name__ == "__main__":
|
97 |
+
if limit:
|
98 |
+
main.queue(concurrency_count=5).launch()
|
99 |
+
else:
|
100 |
+
main.queue(concurrency_count=5).launch(debug=True, share=True)
|