Compare commits
7 Commits
680e24c516
...
7023b54246
| Author | SHA1 | Date | |
|---|---|---|---|
| 7023b54246 | |||
| aee6aa3c04 | |||
| 0a5f335981 | |||
| 2901bd9eaf | |||
| 453b3ca55c | |||
| f0afd1a4bb | |||
| eb572eff27 |
@@ -1,3 +1,8 @@
|
|||||||
|
JIEBA_DATA=./nltk_data
|
||||||
|
NLTK_DATA=./nltk_data
|
||||||
|
SQLITE_DATABASE_URL=sqlite:///./source.db
|
||||||
|
DATA_SOURCE_CACHE=./restapi
|
||||||
|
|
||||||
# The Llama Cloud API key.
|
# The Llama Cloud API key.
|
||||||
# LLAMA_CLOUD_API_KEY=
|
# LLAMA_CLOUD_API_KEY=
|
||||||
SQL_DATABASE_URL=mysql+pymysql://zjinfo1:Dy2Bcr53Hm5xRkba@110.42.234.166:3306/zjinfo1
|
SQL_DATABASE_URL=mysql+pymysql://zjinfo1:Dy2Bcr53Hm5xRkba@110.42.234.166:3306/zjinfo1
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
JIEBA_DATA=./nltk_data
|
||||||
|
NLTK_DATA=./nltk_data
|
||||||
|
SQLITE_DATABASE_URL=sqlite:///./source.db
|
||||||
|
DATA_SOURCE_CACHE=./restapi
|
||||||
|
|
||||||
# The Llama Cloud API key.
|
# The Llama Cloud API key.
|
||||||
# LLAMA_CLOUD_API_KEY=
|
# LLAMA_CLOUD_API_KEY=
|
||||||
SQL_DATABASE_URL=mysql+pymysql://zjinfo1:Dy2Bcr53Hm5xRkba@110.42.234.166:3306/zjinfo1
|
SQL_DATABASE_URL=mysql+pymysql://zjinfo1:Dy2Bcr53Hm5xRkba@110.42.234.166:3306/zjinfo1
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
from typing import Any, Dict, List, Union, Callable, NamedTuple
|
from typing import Any, Dict, List, Union, Callable, NamedTuple
|
||||||
from bm25s.tokenization import *
|
from bm25s.tokenization import *
|
||||||
|
|
||||||
@@ -8,9 +9,12 @@ except ImportError:
|
|||||||
def tqdm(iterable, *args, **kwargs):
|
def tqdm(iterable, *args, **kwargs):
|
||||||
return iterable
|
return iterable
|
||||||
|
|
||||||
|
import jieba
|
||||||
|
jiebapath = os.environ.get("JIEBA_DATA", "")
|
||||||
|
jieba.set_dictionary(os.path.join(jiebapath, 'dict.txt')) #设置字典
|
||||||
|
jieba.initialize() #初始化jeiba
|
||||||
|
|
||||||
def chinese_tokenizer(text: str) -> List[str]:
|
def chinese_tokenizer(text: str) -> List[str]:
|
||||||
import jieba
|
|
||||||
from nltk.corpus import stopwords
|
from nltk.corpus import stopwords
|
||||||
tokens = jieba.lcut(text)
|
tokens = jieba.lcut(text)
|
||||||
return [token for token in tokens if token not in stopwords.words('chinese')]
|
return [token for token in tokens if token not in stopwords.words('chinese')]
|
||||||
|
|||||||
@@ -3,11 +3,10 @@ from typing import Dict
|
|||||||
|
|
||||||
from llama_index.core.constants import DEFAULT_TEMPERATURE
|
from llama_index.core.constants import DEFAULT_TEMPERATURE
|
||||||
from llama_index.core.settings import Settings
|
from llama_index.core.settings import Settings
|
||||||
|
from app.xinference.base import XinferenceEmbedding, XinferenceRerank
|
||||||
from llama_index.llms.xinference import Xinference
|
from llama_index.llms.xinference import Xinference
|
||||||
from llama_index.llms.xinference.base import DEFAULT_XINFERENCE_TEMP
|
from llama_index.llms.xinference.base import DEFAULT_XINFERENCE_TEMP
|
||||||
|
|
||||||
from app.xinference.base import XinferenceEmbedding, XinferenceRerank
|
|
||||||
|
|
||||||
|
|
||||||
def get_node_postprocessors():
|
def get_node_postprocessors():
|
||||||
rerank_enabled = os.getenv("RERANK_ENABLED").title()
|
rerank_enabled = os.getenv("RERANK_ENABLED").title()
|
||||||
@@ -232,4 +231,4 @@ def init_mistral():
|
|||||||
#
|
#
|
||||||
# Settings.llm = MistralAI(model=os.getenv("MODEL"))
|
# Settings.llm = MistralAI(model=os.getenv("MODEL"))
|
||||||
# Settings.embed_model = MistralAIEmbedding(model_name=os.getenv("EMBEDDING_MODEL"))
|
# Settings.embed_model = MistralAIEmbedding(model_name=os.getenv("EMBEDDING_MODEL"))
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
|
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from llama_index.core.node_parser import SentenceSplitter
|
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
+349046
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
@@ -1,9 +1,10 @@
|
|||||||
import os
|
import os
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
load_dotenv()
|
||||||
|
|
||||||
import phoenix as px
|
import phoenix as px
|
||||||
|
|
||||||
|
|
||||||
os.environ['PHOENIX_HOST'] = "0.0.0.0"
|
|
||||||
|
|
||||||
session = px.launch_app(use_temp_dir=False)
|
session = px.launch_app(use_temp_dir=False)
|
||||||
|
|
||||||
import msvcrt
|
import msvcrt
|
||||||
|
|||||||
Reference in New Issue
Block a user