xusenlinzy/api-for-open-llm

在部署时环境文件中PROMPT_NAME=yi 报错 KeyError: 'yi'

Tendo33 opened this issue · 1 comments

提交前必须检查以下项目 | The following items must be checked before submission

  • 请确保使用的是仓库最新代码(git pull),一些问题已被解决和修复。 | Make sure you are using the latest code from the repository (git pull), some issues have already been addressed and fixed.
  • 我已阅读项目文档FAQ章节并且已在Issue中对问题进行了搜索,没有找到相似问题和解决方案 | I have searched the existing issues / discussions

问题类型 | Type of problem

模型推理和部署 | Model inference and deployment

操作系统 | Operating system

Linux

详细描述问题 | Detailed description of the problem

image
在文档里看到 env文件里 可以使用:PROMPT_NAME=yi
但是在尝试的时候,报错

Dependencies

运行日志或截图 | Runtime logs or screenshots

2023-12-06 02:37:47.520 | DEBUG    | api.config:<module>:130 - Config: {'HOST': '0.0.0.0', 'PORT': 8000, 'MODEL_NAME': 'yi-6b-200k', 'MODEL_PATH': '/workspace/share_data/ft_llms/sft_Yi_6B_off7_merge', 'ADAPTER_MODEL_PATH': None, 'RESIZE_EMBEDDINGS': False, 'DEVICE': 'cuda', 'DEVICE_MAP': 'auto', 'GPUS': '', 'NUM_GPUs': 1, 'ONLY_EMBEDDING': False, 'EMBEDDING_NAME': '/workspace/share_data/base_llms/m3e-base', 'EMBEDDING_SIZE': None, 'EMBEDDING_DEVICE': 'cuda', 'QUANTIZE': 16, 'LOAD_IN_8BIT': False, 'LOAD_IN_4BIT': False, 'USING_PTUNING_V2': False, 'CONTEXT_LEN': 200000, 'STREAM_INTERVERL': 2, 'PROMPT_NAME': 'yi', 'PATCH_TYPE': None, 'ALPHA': 'auto', 'API_PREFIX': '/v1', 'USE_VLLM': False, 'TRUST_REMOTE_CODE': False, 'TOKENIZE_MODE': 'auto', 'TENSOR_PARALLEL_SIZE': 1, 'DTYPE': 'half', 'GPU_MEMORY_UTILIZATION': 0.9, 'MAX_NUM_BATCHED_TOKENS': None, 'MAX_NUM_SEQS': 256, 'QUANTIZATION_METHOD': None, 'USE_STREAMER_V2': False, 'API_KEYS': None, 'ACTIVATE_INFERENCE': True}
Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████████████████████████████████| 13/13 [00:17<00:00,  1.32s/it]
Traceback (most recent call last):
  File "api/server.py", line 2, in <module>
    from api.models import EMBEDDED_MODEL, GENERATE_MDDEL, app, VLLM_ENGINE
  File "/workspace/api/models.py", line 133, in <module>
    GENERATE_MDDEL = create_generate_model() if (not config.USE_VLLM and config.ACTIVATE_INFERENCE) else None
  File "/workspace/api/models.py", line 58, in create_generate_model
    return ModelServer(
  File "/workspace/api/generation/core.py", line 59, in __init__
    self.prompt_adapter = get_prompt_adapter(self.model_name, prompt_name=self.prompt_name)
  File "/workspace/api/apapter/conversation.py", line 67, in get_prompt_adapter
    return prompt_adapter_dict[prompt_name]
KeyError: 'yi'

请更新一下项目代码试试