-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'langgenius:main' into lindorm-vdb
- Loading branch information
Showing
246 changed files
with
4,736 additions
and
1,889 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,30 @@ | ||
from app_factory import create_app | ||
from libs import threadings_utils, version_utils | ||
from libs import version_utils | ||
|
||
# preparation before creating app | ||
version_utils.check_supported_python_version() | ||
threadings_utils.apply_gevent_threading_patch() | ||
|
||
|
||
def is_db_command(): | ||
import sys | ||
|
||
if len(sys.argv) > 1 and sys.argv[0].endswith("flask") and sys.argv[1] == "db": | ||
return True | ||
return False | ||
|
||
|
||
# create app | ||
app = create_app() | ||
celery = app.extensions["celery"] | ||
if is_db_command(): | ||
from app_factory import create_migrations_app | ||
|
||
app = create_migrations_app() | ||
else: | ||
from app_factory import create_app | ||
from libs import threadings_utils | ||
|
||
threadings_utils.apply_gevent_threading_patch() | ||
|
||
app = create_app() | ||
celery = app.extensions["celery"] | ||
|
||
if __name__ == "__main__": | ||
app.run(host="0.0.0.0", port=5001) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,9 @@ | ||
from enum import StrEnum | ||
from typing import Literal | ||
|
||
from pydantic import Field | ||
from pydantic_settings import BaseSettings | ||
|
||
|
||
class OpenDALScheme(StrEnum): | ||
FS = "fs" | ||
S3 = "s3" | ||
|
||
|
||
class OpenDALStorageConfig(BaseSettings): | ||
STORAGE_OPENDAL_SCHEME: str = Field( | ||
default=OpenDALScheme.FS.value, | ||
OPENDAL_SCHEME: str = Field( | ||
default="fs", | ||
description="OpenDAL scheme.", | ||
) | ||
# FS | ||
OPENDAL_FS_ROOT: str = Field( | ||
default="storage", | ||
description="Root path for local storage.", | ||
) | ||
# S3 | ||
OPENDAL_S3_ROOT: str = Field( | ||
default="/", | ||
description="Root path for S3 storage.", | ||
) | ||
OPENDAL_S3_BUCKET: str = Field( | ||
default="", | ||
description="S3 bucket name.", | ||
) | ||
OPENDAL_S3_ENDPOINT: str = Field( | ||
default="https://s3.amazonaws.com", | ||
description="S3 endpoint URL.", | ||
) | ||
OPENDAL_S3_ACCESS_KEY_ID: str = Field( | ||
default="", | ||
description="S3 access key ID.", | ||
) | ||
OPENDAL_S3_SECRET_ACCESS_KEY: str = Field( | ||
default="", | ||
description="S3 secret access key.", | ||
) | ||
OPENDAL_S3_REGION: str = Field( | ||
default="", | ||
description="S3 region.", | ||
) | ||
OPENDAL_S3_SERVER_SIDE_ENCRYPTION: Literal["aws:kms", ""] = Field( | ||
default="", | ||
description="S3 server-side encryption.", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.