Spaces:
Running
Running
File size: 533 Bytes
f845b05 f8bf4b8 67fbe89 21c111d f845b05 9eea9dc 4eb15f6 418b839 9eea9dc 7febfc4 9eea9dc cd1c689 9eea9dc f8bf4b8 f845b05 21c111d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import gradio as gr
import subprocess
import piper
import os
def run_command(command):
try:
# Running the command and capturing the output
result = subprocess.run(command, shell=True, text=True, capture_output=True, check=True)
return result.stdout
except subprocess.CalledProcessError as e:
return e.stderr
iface = gr.Interface(
fn=run_command,
inputs='text',
outputs='text',
title="CLI Interface",
description="Enter your command and see the output."
)
iface.launch()
|