fix: ModuleNotFoundError: No module named 'app'
This commit is contained in:
@@ -6,6 +6,14 @@ from uuid import uuid4
|
|||||||
import streamlit as st
|
import streamlit as st
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
|
# Add the root directory of the project to the system path to allow importing modules from the project
|
||||||
|
root_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
||||||
|
if root_dir not in sys.path:
|
||||||
|
sys.path.append(root_dir)
|
||||||
|
print("******** sys.path ********")
|
||||||
|
print(sys.path)
|
||||||
|
print("")
|
||||||
|
|
||||||
from app.config import config
|
from app.config import config
|
||||||
from app.models.const import FILE_TYPE_IMAGES, FILE_TYPE_VIDEOS
|
from app.models.const import FILE_TYPE_IMAGES, FILE_TYPE_VIDEOS
|
||||||
from app.models.schema import (
|
from app.models.schema import (
|
||||||
@@ -19,14 +27,6 @@ from app.services import llm, voice
|
|||||||
from app.services import task as tm
|
from app.services import task as tm
|
||||||
from app.utils import utils
|
from app.utils import utils
|
||||||
|
|
||||||
# Add the root directory of the project to the system path to allow importing modules from the project
|
|
||||||
root_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
|
||||||
if root_dir not in sys.path:
|
|
||||||
sys.path.append(root_dir)
|
|
||||||
print("******** sys.path ********")
|
|
||||||
print(sys.path)
|
|
||||||
print("")
|
|
||||||
|
|
||||||
st.set_page_config(
|
st.set_page_config(
|
||||||
page_title="MoneyPrinterTurbo",
|
page_title="MoneyPrinterTurbo",
|
||||||
page_icon="🤖",
|
page_icon="🤖",
|
||||||
|
|||||||
Reference in New Issue
Block a user