feat: chat2tts stream

This commit is contained in:
verachen
2025-01-09 11:29:34 +08:00
parent ec3b4b143a
commit 37174413fe
12 changed files with 643 additions and 67 deletions

View File

@ -25,7 +25,7 @@ class ChromaQuery(Blackbox):
self.embedding_model_1 = embedding_functions.SentenceTransformerEmbeddingFunction(model_name="/Workspace/Models/BAAI/bge-large-zh-v1.5", device = "cuda:0")
self.embedding_model_2 = embedding_functions.SentenceTransformerEmbeddingFunction(model_name="/Workspace/Models/BAAI/bge-small-en-v1.5", device = "cuda:0")
self.embedding_model_3 = embedding_functions.SentenceTransformerEmbeddingFunction(model_name="/Workspace/Models/BAAI/bge-m3", device = "cuda:0")
self.client_1 = chromadb.HttpClient(host='192.168.0.200', port=7000)
self.client_1 = chromadb.HttpClient(host='10.6.44.141', port=7000)
# self.client_2 = chromadb.HttpClient(host='10.6.82.192', port=8000)
self.reranker_model_1 = CrossEncoder("/Workspace/Models/BAAI/bge-reranker-v2-m3", max_length=512, device = "cuda")
@ -60,7 +60,7 @@ class ChromaQuery(Blackbox):
chroma_embedding_model = "/Workspace/Models/BAAI/bge-large-zh-v1.5"
if chroma_host is None or chroma_host.isspace() or chroma_host == "":
chroma_host = "192.168.0.200"
chroma_host = "10.6.44.141"
if chroma_port is None or chroma_port.isspace() or chroma_port == "":
chroma_port = "7000"
@ -72,7 +72,7 @@ class ChromaQuery(Blackbox):
chroma_n_results = 10
# load client and embedding model from init
if re.search(r"192.168.0.200", chroma_host) and re.search(r"7000", chroma_port):
if re.search(r"10.6.44.141", chroma_host) and re.search(r"7000", chroma_port):
client = self.client_1
else:
try: