Team Ai
Apppublic

Teapack1/Assistant-Audio-Intent-Classification

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
6likes
app.py26 linesDownload Raw Back to root
1import subprocess2 3subprocess.run(["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "2"])4 5#command = ["arecord" "-l"]6#print(command)7#result = subprocess.run(command, stdout=subprocess.PIPE, text=True)8#print("Output:\n", result.stdout)9#os.system("uvicorn server:app --reload")10 11"""12def start_server():   13    os.system("uvicorn server:app --port 8080 --workers 2")14 15def is_port_in_use(port):   16    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:17        return s.connect_ex(('0.0.0.0', port)) == 018 19def main():20    if is_port_in_use(8080):21        print("Port 8080 is already in use. Please kill the process and try again.")22    else:23        start_server()24        25    main()   26"""