Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix(page): ml baseUrl error #3

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pages/Classification/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import useImage from 'use-image';
import PPSetButton from '@/components/PPLabelPage/PPButtonSet';

const port = window.location.port == '8000' ? '1234' : window.location.port;
const baseUrl = `http://${window.location.hostname}:${port}/`;
const baseUrl = `http://${window.location.hostname}:${port}`;
const Page: React.FC = () => {
const page = useRef<pageRef>(null);
const intl = IntlInit('pages.classification');
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Detection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { IntlInitJsx } from '@/components/PPIntl';
import PPSetButton from '@/components/PPLabelPage/PPButtonSet';
import Keyevent from 'react-keyevent';
const port = window.location.port == '8000' ? '1234' : window.location.port;
const baseUrl = `http://${window.location.hostname}:${port}/`;
const baseUrl = `http://${window.location.hostname}:${port}`;
const Page = () => {
// todo: change to use annotation
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down Expand Up @@ -757,7 +757,7 @@ const Page = () => {
</PPToolBarButton>
<PPToolBarButton
imgSrc="./pics/buttons/intelligent_interaction.png"
disabled={!otherSetting?.labelMapping}
// disabled={!otherSetting?.labelMapping}
gouzil marked this conversation as resolved.
Show resolved Hide resolved
onClick={() => {
onPredicted(image);
}}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Ocr/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import PPProgress from '@/components/PPLabelPage/PPProgress';
import { IntlInitJsx } from '@/components/PPIntl';
import PPSetButton from '@/components/PPLabelPage/PPButtonSet';
const port = window.location.port == '8000' ? '1234' : window.location.port;
const baseUrl = `http://${window.location.hostname}:${port}/`;
const baseUrl = `http://${window.location.hostname}:${port}`;
export type DrawToolType = {
polygon: PPDrawToolRet;
brush: undefined;
Expand Down
2 changes: 0 additions & 2 deletions src/services/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { IntlInitJsx } from '@/components/PPIntl';
import type { ToolType, Annotation, Label } from '@/models/';
import { ModelApi } from '@/services/ml';
import type { Model } from '@/services/ml/models';
import { History } from '/Users/v_xiaoyixin/paddlefortends/PaddleLabel-Frontend/node_modules/@umijs/runtime';

const baseUrl = localStorage.getItem('basePath');
const config = new Configuration(baseUrl ? { basePath: baseUrl } : undefined);
Expand Down Expand Up @@ -905,7 +904,6 @@ export function ModelUtils(useState: UseStateType, mlBackendUrl: string = undefi
const [backendUrl, setBackendUrl] = useState<string>(mlBackendUrl);
const [loading, setLoading] = useState<boolean>(false);
const intl = IntlInit('component.PPInteractorModal');
// let modelApi = new ModelApi(new Configuration({ basePath: backendUrl }));
let modelApi = new ModelApi(new Configuration({ basePath: backendUrl }));

async function getAll() {
Expand Down