From 26c31d5b33e7942080d40a1d63e1a024a263e8fb Mon Sep 17 00:00:00 2001 From: mini-omni <> Date: Tue, 5 Nov 2024 18:19:46 +0800 Subject: [PATCH] fix utils import --- server.py | 10 ++++++++-- utils/__init__.py | 0 webui/omni_streamlit.py | 8 +++++++- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 utils/__init__.py 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")