From a72088b7a8f07c2985dd83509148ebb08ee21ec5 Mon Sep 17 00:00:00 2001 From: jialin Date: Thu, 17 Oct 2024 15:08:32 +0800 Subject: [PATCH] chore: rebase main --- .../playground/components/upload-img.tsx | 17 +------------- src/pages/playground/index.tsx | 23 +++++++++---------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/src/pages/playground/components/upload-img.tsx b/src/pages/playground/components/upload-img.tsx index c310aaf8..4f0d6528 100644 --- a/src/pages/playground/components/upload-img.tsx +++ b/src/pages/playground/components/upload-img.tsx @@ -3,7 +3,7 @@ import { useIntl } from '@umijs/max'; import { Button, Tooltip, Upload } from 'antd'; import type { UploadFile } from 'antd/es/upload'; import { RcFile } from 'antd/es/upload'; -import { debounce, round } from 'lodash'; +import { debounce } from 'lodash'; import React, { useCallback, useRef } from 'react'; interface UploadImgProps { @@ -38,21 +38,6 @@ const UploadImg: React.FC = ({ [handleUpdateImgList, intl] ); - const getImgDimensions = useCallback( - (file: any): Promise<{ ratio: number }> => { - return new Promise((resolve) => { - const img = new Image(); - img.onload = () => { - resolve({ ratio: round(img.width / img.height, 2) }); - }; - img.onerror = () => { - resolve({ ratio: 1 }); - }; - img.src = URL.createObjectURL(file); - }); - }, - [] - ); const handleChange = useCallback( async (info: any) => { const { fileList } = info; diff --git a/src/pages/playground/index.tsx b/src/pages/playground/index.tsx index 79b391aa..a1daf9d3 100644 --- a/src/pages/playground/index.tsx +++ b/src/pages/playground/index.tsx @@ -12,7 +12,6 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; import { queryModelsList } from './apis'; import GroundLeft from './components/ground-left'; -import GroundReranker from './components/ground-reranker'; import MultipleChat from './components/multiple-chat'; import './style/play-ground.less'; @@ -73,18 +72,18 @@ const Playground: React.FC = () => { key: 'compare', label: 'Compare', children: - }, - { - key: 'reranker', - label: 'Reranker', - children: ( - - ) } + // { + // key: 'reranker', + // label: 'Reranker', + // children: ( + // + // ) + // } ]; useEffect(() => {