Spaces:
Running
Running
File size: 991 Bytes
66f8fc1 5ce139d 66f8fc1 329f9c0 5ce139d 329f9c0 5ce139d 329f9c0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
import gradio as gr
import os
import subprocess
def install_server():
output = ""
try:
os.mkdir("milvus_compose")
output += "Created directory 'milvus_compose'\n"
subprocess.run(["wget", "https://github.com/milvus-io/milvus/releases/download/v2.3.0-beta/milvus-standalone-docker-compose.yml", "-O", "milvus_compose/docker-compose.yml"], check=True)
output += "Downloaded 'docker-compose.yml'\n"
#subprocess.run(["docker-compose", "up", "-d"], check=True)
#output += "Started Milvus server\n"
except Exception as e:
output += str(e)
return output
def list_files():
files = os.listdir('.')
return files
def run():
iface = gr.Interface(
fn=[install_server, list_files],
inputs=None,
outputs=["text", "text"],
layout="horizontal",
title="Milvus Server Installation"
)
iface.launch(server_name="0.0.0.0", server_port=7860)
if __name__ == "__main__":
run()
|