Spaces:
Running
on
Zero
Running
on
Zero
refactor: Remove format_bash_command and simplify command display
Browse files
app.py
CHANGED
|
@@ -11,8 +11,6 @@ import uuid
|
|
| 11 |
import tempfile
|
| 12 |
import shlex
|
| 13 |
import shutil
|
| 14 |
-
from utils import format_bash_command
|
| 15 |
-
|
| 16 |
HF_API_KEY = os.environ["HF_TOKEN"]
|
| 17 |
|
| 18 |
client = OpenAI(
|
|
@@ -229,7 +227,7 @@ def update(files, prompt, top_p=1, temperature=1):
|
|
| 229 |
output_file_name = f"output_{uuid.uuid4()}.mp4"
|
| 230 |
output_file_path = str((Path(temp_dir) / output_file_name).resolve())
|
| 231 |
subprocess.run(args + ["-y", output_file_path], cwd=temp_dir)
|
| 232 |
-
generated_command = f"### Generated Command\n```bash\
|
| 233 |
return output_file_path, gr.update(value=generated_command)
|
| 234 |
except Exception as e:
|
| 235 |
attempts += 1
|
|
|
|
| 11 |
import tempfile
|
| 12 |
import shlex
|
| 13 |
import shutil
|
|
|
|
|
|
|
| 14 |
HF_API_KEY = os.environ["HF_TOKEN"]
|
| 15 |
|
| 16 |
client = OpenAI(
|
|
|
|
| 227 |
output_file_name = f"output_{uuid.uuid4()}.mp4"
|
| 228 |
output_file_path = str((Path(temp_dir) / output_file_name).resolve())
|
| 229 |
subprocess.run(args + ["-y", output_file_path], cwd=temp_dir)
|
| 230 |
+
generated_command = f"### Generated Command\n```bash\nffmpeg {' '.join(args[1:])} -y output.mp4\n```"
|
| 231 |
return output_file_path, gr.update(value=generated_command)
|
| 232 |
except Exception as e:
|
| 233 |
attempts += 1
|