Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| import os | |
| import subprocess | |
| import platform | |
| # print(os.system('nvidia-smi')) | |
| def get_disk_usage(): | |
| with open("111.txt", 'w') as file: | |
| file.write(result.stdout) | |
| try: | |
| tree = subprocess.run(['tree'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) | |
| print(tree.stderr) | |
| result = subprocess.run(['du', '-h', './'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) | |
| if result.returncode != 0: | |
| print(f"Error: {result.stderr}") | |
| else: | |
| print(result.stdout) | |
| print(f"Disk usage information written to {filename}") | |
| except Exception as e: | |
| print(f"An error occurred: {e}") | |
| def get_system_info(): | |
| print("=== System Information ===") | |
| print(f"System: {platform.system()}") | |
| print(f"Node Name: {platform.node()}") | |
| print(f"Release: {platform.release()}") | |
| print(f"Version: {platform.version()}") | |
| print(f"Machine: {platform.machine()}") | |
| print(f"Processor: {platform.processor()}") | |
| print(f"Architecture: {platform.architecture()}") | |
| print(f"python: {platform.python_version()}") | |
| get_disk_usage() | |
| get_system_info() | |
| def greet(name, intensity): | |
| return "Hello, " + name + "!" * int(intensity) | |
| demo = gr.Interface( | |
| fn=greet, | |
| inputs=["text", "slider"], | |
| outputs=["text"], | |
| ) | |
| demo.launch() |