-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
3,194 additions
and
3 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
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 |
---|---|---|
|
@@ -7,3 +7,6 @@ pymysql | |
gevent==24.2.* | ||
Flask==2.2.* | ||
apscheduler | ||
unstructured[docx,pptx] | ||
transformers | ||
ndjson |
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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import os | ||
import sys | ||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
FILE_SERVER = '' | ||
|
||
APP_NAME = 'semantic-search' | ||
|
||
SECRET_KEY = '' | ||
SEAFILE_SERVER = '' | ||
|
||
# log | ||
LOG_FILE = None | ||
LOG_LEVEL = 'info' | ||
ENABLE_SYS_LOG = False | ||
|
||
# sections | ||
## indexManager worker count | ||
INDEX_MANAGER_WORKERS = 2 | ||
INDEX_TASK_EXPIRE_TIME = 30 * 60 | ||
|
||
RETRIEVAL_NUM = 20 | ||
|
||
# embedding dimension | ||
DIMENSION = 768 | ||
|
||
MODEL_VOCAB_PATH = '' | ||
FILE_SENTENCE_LIMIT = 1000 | ||
|
||
THRESHOLD = 0.01 | ||
|
||
## seasearch | ||
SEASEARCH_SERVER = 'http://127.0.0.1:4080' | ||
SEASEARCH_TOKEN = '' | ||
VECTOR_M = 256 | ||
SHARD_NUM = 1 | ||
|
||
## sea-embedding | ||
SEA_EMBEDDING_SERVER = '' | ||
SEA_EMBEDDING_KEY = '' | ||
|
||
EMBEDDING_API_TYPE = 'sea-embedding' | ||
|
||
# seafile config database | ||
MYSQL_HOST = '' | ||
MYSQL_USER = '' | ||
MYSQL_PASSWORD = '' | ||
MYSQL_PORT = 3306 | ||
MYSQL_DB = 'seafile' | ||
MYSQL_UNIX_SOCKET = '' | ||
|
||
# repo file index support file types | ||
SUPPORT_INDEX_FILE_TYPES = [ | ||
'.sdoc', | ||
'.md', | ||
'.markdown', | ||
'.doc', | ||
'.docx', | ||
'.ppt', | ||
'.pptx', | ||
'.pdf', | ||
] | ||
|
||
|
||
CONF_DIR = '/opt/seafile/conf/' | ||
|
||
try: | ||
import seahub.settings as seahub_settings | ||
SEA_EMBEDDING_SERVER = getattr(seahub_settings, 'SEA_EMBEDDING_SERVER', '') | ||
SEA_EMBEDDING_KEY = getattr(seahub_settings, 'SEA_EMBEDDING_KEY', '') | ||
SEASEARCH_SERVER = getattr(seahub_settings, 'SEASEARCH_SERVER', '') | ||
SEASEARCH_TOKEN = getattr(seahub_settings, 'SEASEARCH_TOKEN', '') | ||
MODEL_VOCAB_PATH = getattr(seahub_settings, 'MODEL_VOCAB_PATH', '') | ||
MODEL_CACHE_DIR = getattr(seahub_settings, 'MODEL_CACHE_DIR', '') | ||
INDEX_STORAGE_PATH = getattr(seahub_settings, 'INDEX_STORAGE_PATH', '') | ||
except ImportError: | ||
logger.critical("Can not import seahub settings.") | ||
raise RuntimeError("Can not import seahub settings.") | ||
|
||
|
||
try: | ||
|
||
if os.path.exists('/data/dev/seafevents/semantic_search/semantic_search_settings.py'): | ||
from seafevents.semantic_search.semantic_search_settings import * | ||
except: | ||
pass | ||
|
||
try: | ||
if os.path.exists(CONF_DIR): | ||
sys.path.insert(0, CONF_DIR) | ||
from seafile_ai_settings import * | ||
except ImportError as e: | ||
pass |
Oops, something went wrong.