Comments (4)
Your service has successfully started on port 20002, as indicated by the log messages. The deprecation warning about model startup functionality and the TypedStorage
deprecation are not critical for operation but suggest areas for future attention:
-
Deprecation Warning: The functionality for model startup is set to be rewritten in Langchain-Chatchat 0.3.x to support more modes and faster startup. It's advisable to stay updated with the project's releases to adapt your code for future versions.
-
TypedStorage
Deprecation: This warning indicates thatTypedStorage
will be removed in future releases. While this doesn't immediately affect your service's operation, you should monitor for updates or guidance from Langchain-Chatchat on how to address this deprecation.
Ensure your application's functionality is not impacted by these warnings by testing thoroughly. For any adjustments or issues, consulting the Langchain-Chatchat documentation or community support channels can provide specific guidance.
Details
Sources
- 执行python startup.py -a 失败
- [BUG] 执行python startup.py -a报错,请大神帮忙解决下
- 执行python startup.py -a正常,但是网页端Not Found
- startup.py
- configs/model_config.py.example
- server/model_workers/zhipu.py
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.
from langchain-chatchat.
在本地进行模型部署,并未使用API
==============================Langchain-Chatchat Configuration==============================
操作系统:Windows-10-10.0.22631-SP0.
python版本:3.11.7 | packaged by Anaconda, Inc. | (main, Dec 15 2023, 18:05:47) [MSC v.1916 64 bit (AMD64)]
项目版本:v0.2.10
langchain版本:0.0.354. fastchat版本:0.2.35
当前使用的分词器:ChineseRecursiveTextSplitter
当前启动的LLM模型:['chatglm2-6b-int4', 'zhipu-api', 'openai-api'] @ cpu
{'device': 'cpu',
'host': '127.0.0.1',
'infer_turbo': False,
'model_path': 'D:\NLP\Langchain-Chatchat\chatglm2-6b-int4',
'model_path_exists': True,
'port': 20002}
{'api_key': '',
'device': 'auto',
'host': '127.0.0.1',
'infer_turbo': False,
'online_api': True,
'port': 21001,
'provider': 'ChatGLMWorker',
'version': 'glm-4',
'worker_class': <class 'server.model_workers.zhipu.ChatGLMWorker'>}
{'api_base_url': 'https://api.openai.com/v1',
'api_key': '',
'device': 'auto',
'host': '127.0.0.1',
'infer_turbo': False,
'model_name': 'gpt-4',
'online_api': True,
'openai_proxy': '',
'port': 20002}
当前Embbedings模型: m3e-base @ cpu
==============================Langchain-Chatchat Configuration==============================
2024-04-26 14:50:19,705 - startup.py[line:655] - INFO: 正在启动服务:
2024-04-26 14:50:19,705 - startup.py[line:656] - INFO: 如需查看 llm_api 日志,请前往 D:\NLP\Langchain-Chatchat\logs
D:\Learning\miniconda3\envs\LangChain-ChatChat\Lib\site-packages\langchain_core_api\deprecation.py:117: LangChainDeprecationWarning: 模型启动功能将于 Langchain-Chatchat 0.3.x重写,支持更多模式和加速启动,0.2.x中相关功能将废弃
warn_deprecated(
2024-04-26 14:50:24 | INFO | model_worker | Register to controller
2024-04-26 14:50:24 | ERROR | stderr | INFO: Started server process [9808]
2024-04-26 14:50:24 | ERROR | stderr | INFO: Waiting for application startup.
2024-04-26 14:50:24 | ERROR | stderr | INFO: Application startup complete.
2024-04-26 14:50:24 | ERROR | stderr | INFO: Uvicorn running on http://127.0.0.1:8888 (Press CTRL+C to quit)
2024-04-26 14:50:25 | INFO | model_worker | Loading the model ['chatglm2-6b-int4'] on worker fcc2c3d5 ...
2024-04-26 14:50:25 | ERROR | stderr | D:\Learning\miniconda3\envs\LangChain-ChatChat\Lib\site-packages\torch_utils.py:831: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly. To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
2024-04-26 14:50:25 | ERROR | stderr | return self.fget.get(instance, owner)()
2024-04-26 14:50:29 | INFO | stdout | INFO: 127.0.0.1:54042 - "GET / HTTP/1.1" 404 Not Found
2024-04-26 14:50:29 | INFO | stdout | INFO: 127.0.0.1:54042 - "GET /favicon.ico HTTP/1.1" 404 Not Found
当点击词端口时候显示
{“详细信息”:“未找到”}
from langchain-chatchat.
$ python server/llm_api.py
当运行这段代码时候
Traceback (most recent call last):
File "D:\NLP\Langchain-Chatchat\server\llm_api.py", line 4, in
from configs import logger, log_verbose, LLM_MODELS, HTTPX_DEFAULT_TIMEOUT
ModuleNotFoundError: No module named 'configs'
也会持续这段,但是源代码并没有报错
源代码:
from fastapi import Body
import sys
sys.path.append("D:\NLP\Langchain-Chatchat\configs")
from configs import logger, log_verbose, LLM_MODELS, HTTPX_DEFAULT_TIMEOUT
from server.utils import (BaseResponse, fschat_controller_address, list_config_llm_models,get_httpx_client, get_model_worker_config)
from typing import List
def list_running_models(
controller_address: str = Body(None, description="Fastchat controller服务器地址", examples=[fschat_controller_address()]),
placeholder: str = Body(None, description="该参数未使用,占位用"),
) -> BaseResponse:
'''
从fastchat controller获取已加载模型列表及其配置项
'''
try:
controller_address = controller_address or fschat_controller_address()
with get_httpx_client() as client:
r = client.post(controller_address + "/list_models")
models = r.json()["models"]
data = {m: get_model_config(m).data for m in models}
return BaseResponse(data=data)
except Exception as e:
logger.error(f'{e.class.name}: {e}',
exc_info=e if log_verbose else None)
return BaseResponse(
code=500,
data={},
msg=f"failed to get available models from controller: {controller_address}。错误信息是: {e}")
def list_config_models(
types: List[str] = Body(["local", "online"], description="模型配置项类别,如local, online, worker"),
placeholder: str = Body(None, description="占位用,无实际效果")
) -> BaseResponse:
'''
从本地获取configs中配置的模型列表
'''
data = {}
for type, models in list_config_llm_models().items():
if type in types:
data[type] = {m: get_model_config(m).data for m in models}
return BaseResponse(data=data)
def get_model_config(
model_name: str = Body(description="配置中LLM模型的名称"),
placeholder: str = Body(None, description="占位用,无实际效果")
) -> BaseResponse:
'''
获取LLM模型配置项(合并后的)
'''
config = {}
# 删除ONLINE_MODEL配置中的敏感信息
for k, v in get_model_worker_config(model_name=model_name).items():
if not (k == "worker_class"
or "key" in k.lower()
or "secret" in k.lower()
or k.lower().endswith("id")):
config[k] = v
return BaseResponse(data=config)
def stop_llm_model(
model_name: str = Body(..., description="要停止的LLM模型名称", examples=[LLM_MODELS[0]]),
controller_address: str = Body(None, description="Fastchat controller服务器地址", examples=[fschat_controller_address()])
) -> BaseResponse:
'''
向fastchat controller请求停止某个LLM模型。
注意:由于Fastchat的实现方式,实际上是把LLM模型所在的model_worker停掉。
'''
try:
controller_address = controller_address or fschat_controller_address()
with get_httpx_client() as client:
r = client.post(
controller_address + "/release_worker",
json={"model_name": model_name},
)
return r.json()
except Exception as e:
logger.error(f'{e.class.name}: {e}',
exc_info=e if log_verbose else None)
return BaseResponse(
code=500,
msg=f"failed to stop LLM model {model_name} from controller: {controller_address}。错误信息是: {e}")
def change_llm_model(
model_name: str = Body(..., description="当前运行模型", examples=[LLM_MODELS[0]]),
new_model_name: str = Body(..., description="要切换的新模型", examples=[LLM_MODELS[0]]),
controller_address: str = Body(None, description="Fastchat controller服务器地址", examples=[fschat_controller_address()])
):
'''
向fastchat controller请求切换LLM模型。
'''
try:
controller_address = controller_address or fschat_controller_address()
with get_httpx_client() as client:
r = client.post(
controller_address + "/release_worker",
json={"model_name": model_name, "new_model_name": new_model_name},
timeout=HTTPX_DEFAULT_TIMEOUT, # wait for new worker_model
)
return r.json()
except Exception as e:
logger.error(f'{e.class.name}: {e}',
exc_info=e if log_verbose else None)
return BaseResponse(
code=500,
msg=f"failed to switch LLM model from controller: {controller_address}。错误信息是: {e}")
def list_search_engines() -> BaseResponse:
from server.chat.search_engine_chat import SEARCH_ENGINES
return BaseResponse(data=list(SEARCH_ENGINES))
from langchain-chatchat.
依赖没装对吧,或者模型没全
from langchain-chatchat.
Related Issues (20)
- 本地部署模型,启动error,Register to controller报错socket.gaierror: Name or service not known HOT 2
- ollama本地或docker启动,ollama pull llama3 或deepseek-llm,在model_config.py中选择列表中加上,同时online llm中加上ollama的OLLAMA_BASE_URL (http://127.0.0.1:11434) HOT 2
- 想在使用文件对话时使用自己的提示词,想要的回答时结构化的格式输出,我在自定义提示词的时候如何写我需要结构化方式的回答? HOT 6
- 知识库问答出处显示None HOT 1
- 模型从chatglm3-6b切换到qwen-1_8B的时候对话就会报错 HOT 3
- [询问] 方舟豆包依赖pydantic和fschat冲突 HOT 2
- [BUG] 导入微调后的模型,直接没法正常输出 / Concise description of the issue HOT 1
- 是否支持导入QA问答对类型的csv文件 HOT 2
- openai_api连接本地部署的ollama模型出错 HOT 3
- 2.10版本是否支持BlueLM-7B-Chat,BlueLM-7B-Chat-32k 按默认的配置设置路径后,python startup.py -a无法启动 HOT 2
- langchain-chatchat在使用chatglm3-6b-128k本地模型启用的时候,问答bug,无论是LLM还是知识库问答还是其他模式 HOT 3
- 如何设置向量数据库的metadata?
- 文件比较多时,要运行几十个小时,一旦出错或者意外终止,数据库就损害了要重新生成。这里每处理100个重新保存一下 HOT 2
- Qwen1.5-14B-Chat在Langchain-Chatchat启动,长时间停止在Loading checkpoint shards: 75% HOT 4
- 运行不通,有AssertionError错误 HOT 1
- 数据库被锁定[BUG] 简洁阐述问题 / Concise description of the issue
- 使用文件对话上传文件能够正常的检索文件,但使用知识库上传相同文件却显示知识库无法匹配 HOT 6
- 关于请求API并发性能问题
- 是否支持非docker arm架构下部署,或者未来会支持
- 针对知识库中的文档对话 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from langchain-chatchat.