diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30b637e23..5e68958a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,6 +110,12 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build backend and push id: docker_build_backend run: | @@ -158,6 +164,12 @@ jobs: - name: Set Environment Variable run: echo "RELEASE_VERSION=${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_ENV + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: set up Docker Buildx + uses: docker/setup-buildx-action@v3 + # 登录 docker hub - name: Login to DockerHub uses: docker/login-action@v1 diff --git a/src/backend/bisheng/interface/llms/custom.py b/src/backend/bisheng/interface/llms/custom.py index 60f99ead9..0fd20ed16 100644 --- a/src/backend/bisheng/interface/llms/custom.py +++ b/src/backend/bisheng/interface/llms/custom.py @@ -207,52 +207,6 @@ class BishengLLM(BaseChatModel): params = params_handler(default_params, server_config, model_config) return params - params = {} - if server_info.config: - params.update(server_info.config) - enable_web_search = False - if model_info.config: - enable_web_search = model_info.config.get('enable_web_search', False) - if model_info.config.get('max_tokens'): - params['max_tokens'] = model_info.config.get('max_tokens') - - params.update({ - 'model_name': model_info.model_name, - 'streaming': self.streaming, - 'temperature': self.temperature, - 'top_p': self.top_p, - 'cache': self.cache - }) - if server_info.type == LLMServerType.OLLAMA.value: - params['model'] = params.pop('model_name') - if params.get('max_tokens'): - params['num_ctx'] = params.pop('max_tokens') - elif server_info.type == LLMServerType.AZURE_OPENAI.value: - params['azure_deployment'] = params.pop('model_name') - elif server_info.type == LLMServerType.QIAN_FAN.value: - params['model'] = params.pop('model_name') - params['qianfan_ak'] = params.pop('wenxin_api_key') - params['qianfan_sk'] = params.pop('wenxin_secret_key') - if params.get('max_tokens'): - params['model_kwargs'] = {"max_output_tokens": params.pop('max_tokens')} - elif server_info.type == LLMServerType.SPARK.value: - params['openai_api_key'] = f'{params.pop("api_key")}:{params.pop("api_secret")}' - elif server_info.type in [LLMServerType.XINFERENCE.value, LLMServerType.LLAMACPP.value, - LLMServerType.VLLM.value]: - params['openai_api_key'] = params.pop('openai_api_key', None) or "EMPTY" - elif server_info.type == LLMServerType.QWEN.value: - params['dashscope_api_key'] = params.pop('openai_api_key') - params.pop('openai_api_base', None) - params['model_kwargs'] = {'enable_search': enable_web_search} - if params.get('max_tokens'): - params['model_kwargs']['max_tokens'] = params.pop('max_tokens') - elif server_info.type == LLMServerType.TENCENT.value: - params['extra_body'] = {'enable_enhancement': enable_web_search} - elif server_info.type == LLMServerType.MINIMAX.value: - params['api_key'] = params.pop('openai_api_key', None) - params.pop('openai_api_base', None) - return params - def _get_default_params(self, server_config: dict, model_config: dict) -> dict: default_params = { 'model': self.model_info.model_name, @@ -446,7 +400,6 @@ class BishengLLM(BaseChatModel): def _update_model_status(self, status: int, remark: str = ''): """更新模型状态""" - # todo 接入到异步任务模块 累计5分钟更新一次 if self.model_info.status != status: self.model_info.status = status LLMDao.update_model_status(self.model_id, status, remark[:500])