Giter Club home page Giter Club logo

Comments (4)

dosubot avatar dosubot commented on June 12, 2024 2

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:

  1. 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.

  2. TypedStorage Deprecation: This warning indicates that TypedStorage 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


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.

ChirdAnti-AK avatar ChirdAnti-AK commented on June 12, 2024

在本地进行模型部署,并未使用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
当点击词端口时候显示
{“详细信息”:“未找到”}

@dosu

from langchain-chatchat.

ChirdAnti-AK avatar ChirdAnti-AK commented on June 12, 2024

$ 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.

zRzRzRzRzRzRzR avatar zRzRzRzRzRzRzR commented on June 12, 2024

依赖没装对吧,或者模型没全

from langchain-chatchat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.