diff --git a/server.py b/server.py index c6e5d98..6d207fc 100644 --- a/server.py +++ b/server.py @@ -1,9 +1,15 @@ +import sys +import os + +sys.path.append(os.path.dirname(os.path.abspath(__file__))) + + +from inference import OmniInference import flask import base64 import tempfile import traceback from flask import Flask, Response, stream_with_context -from inference import OmniInference class OmniChatServer(object): @@ -54,4 +60,4 @@ def serve(ip='0.0.0.0', port=60808, device='cuda:0'): if __name__ == "__main__": import fire fire.Fire(serve) - + diff --git a/utils/__init__.py b/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/webui/omni_streamlit.py b/webui/omni_streamlit.py index 9fcebf0..759a64b 100644 --- a/webui/omni_streamlit.py +++ b/webui/omni_streamlit.py @@ -1,3 +1,10 @@ +import sys +import os + +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +from utils.vad import get_speech_timestamps, collect_chunks, VadOptions + + import streamlit as st import wave @@ -13,7 +20,6 @@ import tempfile import librosa import traceback from pydub import AudioSegment -from utils.vad import get_speech_timestamps, collect_chunks, VadOptions API_URL = os.getenv("API_URL", "http://127.0.0.1:60808/chat")