Skip to content

Commit

Permalink
Merge branch 'langgenius:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Woo0ood authored Dec 19, 2024
2 parents f39a587 + de3911e commit 47baa65
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def validate_provider_credentials(self, credentials: dict) -> None:
try:
model_instance = self.get_model_instance(ModelType.LLM)

model_instance.validate_credentials(model="deepseek-ai/DeepSeek-V2-Chat", credentials=credentials)
model_instance.validate_credentials(model="deepseek-ai/DeepSeek-V2.5", credentials=credentials)
except CredentialsValidateFailedError as ex:
raise ex
except Exception as ex:
Expand Down
5 changes: 5 additions & 0 deletions api/core/rag/embedding/cached_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ def embed_documents(self, texts: list[str]) -> list[list[float]]:
for vector in embedding_result.embeddings:
try:
normalized_embedding = (vector / np.linalg.norm(vector)).tolist()
# stackoverflow best way: https://stackoverflow.com/questions/20319813/how-to-check-list-containing-nan
if np.isnan(normalized_embedding).any():
# for issue #11827 float values are not json compliant
logger.warning(f"Normalized embedding is nan: {normalized_embedding}")
continue
embedding_queue_embeddings.append(normalized_embedding)
except IntegrityError:
db.session.rollback()
Expand Down
12 changes: 9 additions & 3 deletions web/app/components/tools/add-tool-modal/empty.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
'use client'
import { useSearchParams } from 'next/navigation'
import { useTranslation } from 'react-i18next'

const Empty = () => {
const { t } = useTranslation()
const searchParams = useSearchParams()

return (
<div className='flex flex-col items-center'>
<div className="shrink-0 w-[163px] h-[149px] bg-cover bg-no-repeat bg-[url('~@/app/components/tools/add-tool-modal/empty.png')]"></div>
<div className='mb-1 text-[13px] font-medium text-text-primary leading-[18px]'>{t('tools.addToolModal.emptyTitle')}</div>
<div className='text-[13px] text-text-tertiary leading-[18px]'>{t('tools.addToolModal.emptyTip')}</div>
<div className='mb-1 text-[13px] font-medium text-text-primary leading-[18px]'>
{t(`tools.addToolModal.${searchParams.get('category') === 'workflow' ? 'emptyTitle' : 'emptyTitleCustom'}`)}
</div>
<div className='text-[13px] text-text-tertiary leading-[18px]'>
{t(`tools.addToolModal.${searchParams.get('category') === 'workflow' ? 'emptyTip' : 'emptyTipCustom'}`)}
</div>
</div>
)
}
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/en-US/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const translation = {
manageInTools: 'Manage in Tools',
emptyTitle: 'No workflow tool available',
emptyTip: 'Go to "Workflow -> Publish as Tool"',
emptyTitleCustom: 'No custom tool available',
emptyTipCustom: 'Create a custom tool',
},
createTool: {
title: 'Create Custom Tool',
Expand Down
2 changes: 2 additions & 0 deletions web/i18n/zh-Hans/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const translation = {
manageInTools: '去工具列表管理',
emptyTitle: '没有可用的工作流工具',
emptyTip: '去 “工作流 -> 发布为工具” 添加',
emptyTitleCustom: '没有可用的自定义工具',
emptyTipCustom: '创建自定义工具',
},
createTool: {
title: '创建自定义工具',
Expand Down

0 comments on commit 47baa65

Please sign in to comment.