Skip to content

Commit

Permalink
fix: typos
Browse files Browse the repository at this point in the history
* fix: typos
  • Loading branch information
shaohuzhang1 authored Apr 15, 2024
1 parent e15dc64 commit 3d28d25
Show file tree
Hide file tree
Showing 25 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ share/python-wheels/
MANIFEST

# PyInstaller
# Usually these files are written by a python script froms a template
# Usually these files are written by a python script forms a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
Expand Down
4 changes: 2 additions & 2 deletions apps/application/serializers/application_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def insert(self, application: Dict):
application_model = ApplicationSerializer.Create.to_application_model(user_id, application)
dataset_id_list = application.get('dataset_id_list', [])
application_dataset_mapping_model_list = [
ApplicationSerializer.Create.to_application_dateset_mapping(application_model.id, dataset_id) for
ApplicationSerializer.Create.to_application_dataset_mapping(application_model.id, dataset_id) for
dataset_id in dataset_id_list]
# 插入应用
application_model.save()
Expand All @@ -280,7 +280,7 @@ def to_application_model(user_id: str, application: Dict):
)

@staticmethod
def to_application_dateset_mapping(application_id: str, dataset_id: str):
def to_application_dataset_mapping(application_id: str, dataset_id: str):
return ApplicationDatasetMapping(id=uuid.uuid1(), application_id=application_id, dataset_id=dataset_id)

class HitTest(serializers.Serializer):
Expand Down
10 changes: 5 additions & 5 deletions apps/application/serializers/chat_message_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ def chat(self):
client_id = self.data.get('client_id')
client_type = self.data.get('client_type')
chat_info = self.is_valid(raise_exception=True)
pipline_manage_builder = PipelineManage.builder()
pipeline_manage_builder = PipelineManage.builder()
# 如果开启了问题优化,则添加上问题优化步骤
if chat_info.application.problem_optimization:
pipline_manage_builder.append_step(BaseResetProblemStep)
pipeline_manage_builder.append_step(BaseResetProblemStep)
# 构建流水线管理器
pipline_message = (pipline_manage_builder.append_step(BaseSearchDatasetStep)
pipeline_message = (pipeline_manage_builder.append_step(BaseSearchDatasetStep)
.append_step(BaseGenerateHumanMessageStep)
.append_step(BaseChatStep)
.build())
Expand All @@ -198,8 +198,8 @@ def chat(self):
params = chat_info.to_pipeline_manage_params(message, get_post_handler(chat_info), exclude_paragraph_id_list,
client_id, client_type, stream)
# 运行流水线作业
pipline_message.run(params)
return pipline_message.context['chat_result']
pipeline_message.run(params)
return pipeline_message.context['chat_result']

@staticmethod
def re_open_chat(chat_id: str):
Expand Down
2 changes: 1 addition & 1 deletion apps/common/event/listener_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def delete_embedding_by_dataset_id_list(source_ids: List[str]):

@staticmethod
@poxy
def init_embedding_model(ags):
def init_embedding_model(ages):
EmbeddingModel.get_embedding_model()

def run(self):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
from typing import Dict

from common.froms.base_field import BaseExecField, TriggerType
from common.forms.base_field import BaseExecField, TriggerType


class ArrayCard(BaseExecField):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@date:2023/11/1 16:04
@desc:
"""
from common.froms import BaseField
from common.forms import BaseField


class BaseForm:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
from typing import List, Dict

from common.froms.base_field import BaseExecField, TriggerType
from common.forms.base_field import BaseExecField, TriggerType


class MultiSelect(BaseExecField):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
from typing import Dict

from common.froms.base_field import BaseExecField, TriggerType
from common.forms.base_field import BaseExecField, TriggerType


class ObjectCard(BaseExecField):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
from typing import Dict

from common.froms import BaseField, TriggerType
from common.forms import BaseField, TriggerType


class PasswordInputField(BaseField):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
from typing import List, Dict

from common.froms.base_field import BaseExecField, TriggerType
from common.forms.base_field import BaseExecField, TriggerType


class Radio(BaseExecField):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
from typing import List, Dict

from common.froms.base_field import BaseExecField, TriggerType
from common.forms.base_field import BaseExecField, TriggerType


class Radio(BaseExecField):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
from typing import List, Dict

from common.froms.base_field import BaseExecField, TriggerType
from common.forms.base_field import BaseExecField, TriggerType


class Radio(BaseExecField):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
from typing import List, Dict

from common.froms.base_field import TriggerType, BaseExecField
from common.forms.base_field import TriggerType, BaseExecField


class SingleSelect(BaseExecField):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
from typing import Dict

from common.froms.base_field import BaseExecField, TriggerType
from common.forms.base_field import BaseExecField, TriggerType


class TabCard(BaseExecField):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
from typing import Dict

from common.froms.base_field import TriggerType, BaseExecField
from common.forms.base_field import TriggerType, BaseExecField


class TableRadio(BaseExecField):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
from typing import Dict

from common.froms.base_field import TriggerType, BaseExecField
from common.forms.base_field import TriggerType, BaseExecField


class TableRadio(BaseExecField):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
from typing import Dict

from common.froms.base_field import BaseField, TriggerType
from common.forms.base_field import BaseField, TriggerType


class TextInputField(BaseField):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
from langchain.schema import HumanMessage
from langchain_community.chat_models.azure_openai import AzureChatOpenAI

from common import froms
from common import forms
from common.exception.app_exception import AppApiException
from common.froms import BaseForm
from common.forms import BaseForm
from common.util.file_util import get_file_content
from setting.models_provider.base_model_provider import IModelProvider, ModelProvideInfo, BaseModelCredential, \
ModelInfo, \
Expand Down Expand Up @@ -51,11 +51,11 @@ def is_valid(self, model_type: str, model_name, model_credential: Dict[str, obje
def encryption_dict(self, model: Dict[str, object]):
return {**model, 'api_key': super().encryption(model.get('api_key', ''))}

api_base = froms.TextInputField('API 域名', required=True)
api_base = forms.TextInputField('API 域名', required=True)

api_key = froms.PasswordInputField("API Key", required=True)
api_key = forms.PasswordInputField("API Key", required=True)

deployment_name = froms.TextInputField("部署名", required=True)
deployment_name = forms.TextInputField("部署名", required=True)


class DefaultAzureLLMModelCredential(BaseForm, BaseModelCredential):
Expand Down Expand Up @@ -87,13 +87,13 @@ def is_valid(self, model_type: str, model_name, model_credential: Dict[str, obje
def encryption_dict(self, model: Dict[str, object]):
return {**model, 'api_key': super().encryption(model.get('api_key', ''))}

api_version = froms.TextInputField("api_version", required=True)
api_version = forms.TextInputField("api_version", required=True)

api_base = froms.TextInputField('API 域名', required=True)
api_base = forms.TextInputField('API 域名', required=True)

api_key = froms.PasswordInputField("API Key", required=True)
api_key = forms.PasswordInputField("API Key", required=True)

deployment_name = froms.TextInputField("部署名", required=True)
deployment_name = forms.TextInputField("部署名", required=True)


azure_llm_model_credential = AzureLLMModelCredential()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import requests
from langchain.chat_models.base import BaseChatModel

from common import froms
from common import forms
from common.exception.app_exception import AppApiException
from common.froms import BaseForm
from common.forms import BaseForm
from common.util.file_util import get_file_content
from setting.models_provider.base_model_provider import IModelProvider, ModelProvideInfo, ModelInfo, ModelTypeConst, \
BaseModelCredential, DownModelChunk, DownModelChunkStatus, ValidCode
Expand Down Expand Up @@ -51,8 +51,8 @@ def build_model(self, model_info: Dict[str, object]):
self.api_key = model_info.get('api_key')
return self

api_base = froms.TextInputField('API 域名', required=True)
api_key = froms.PasswordInputField('API Key', required=True)
api_base = forms.TextInputField('API 域名', required=True)
api_key = forms.PasswordInputField('API Key', required=True)


ollama_llm_model_credential = OllamaLLMModelCredential()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
from langchain.schema import HumanMessage
from langchain_openai import ChatOpenAI

from common import froms
from common import forms
from common.exception.app_exception import AppApiException
from common.froms import BaseForm
from common.forms import BaseForm
from common.util.file_util import get_file_content
from setting.models_provider.base_model_provider import IModelProvider, ModelProvideInfo, BaseModelCredential, \
ModelInfo, \
Expand Down Expand Up @@ -50,8 +50,8 @@ def is_valid(self, model_type: str, model_name, model_credential: Dict[str, obje
def encryption_dict(self, model: Dict[str, object]):
return {**model, 'api_key': super().encryption(model.get('api_key', ''))}

api_base = froms.TextInputField('API 域名', required=True)
api_key = froms.PasswordInputField('API Key', required=True)
api_base = forms.TextInputField('API 域名', required=True)
api_key = forms.PasswordInputField('API Key', required=True)


openai_llm_model_credential = OpenAILLMModelCredential()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
from langchain_community.chat_models import QianfanChatEndpoint
from qianfan import ChatCompletion

from common import froms
from common import forms
from common.exception.app_exception import AppApiException
from common.froms import BaseForm
from common.forms import BaseForm
from common.util.file_util import get_file_content
from setting.models_provider.base_model_provider import ModelProvideInfo, ModelTypeConst, BaseModelCredential, \
ModelInfo, IModelProvider, ValidCode
Expand Down Expand Up @@ -55,9 +55,9 @@ def build_model(self, model_info: Dict[str, object]):
self.secret_key = model_info.get('secret_key')
return self

api_key = froms.PasswordInputField('API Key', required=True)
api_key = forms.PasswordInputField('API Key', required=True)

secret_key = froms.PasswordInputField("Secret Key", required=True)
secret_key = forms.PasswordInputField("Secret Key", required=True)


win_xin_llm_model_credential = WenxinLLMModelCredential()
Expand Down
6 changes: 3 additions & 3 deletions apps/smartdoc/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
1. Add an import: froms my_app import views
1. Add an import: forms my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: froms other_app.views import Home
1. Add an import: forms other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: froms django.urls import include, path
1. Import the include() function: forms django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
import os
Expand Down
4 changes: 2 additions & 2 deletions installer/run-maxkb.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

# Start postgress
# Start postgresql
docker-entrypoint.sh postgres &
sleep 10
# Wait postgress
# Wait postgresql
until pg_isready --host=127.0.0.1; do sleep 1 && echo "waiting for postgres"; done

# Start MaxKB
Expand Down

0 comments on commit 3d28d25

Please sign in to comment.