Skip to content

Commit

Permalink
fixed react frontend (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
vamsikrishnagok authored Feb 7, 2024
1 parent d67afc4 commit c5b0e17
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 21 deletions.
8 changes: 4 additions & 4 deletions backend/params/specifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ class Specifications:
def __init__(self, model_path='backend/models', datasets_path='backend/datasets'):

self._list_datasets_summarization = parse_objects(
datasets_path, '/summarization/')
self._list_datasets_search = parse_objects(datasets_path, '/search/')
datasets_path, '/common/')
self._list_datasets_search = parse_objects(datasets_path, '/common/')

self._list_models_summarization = parse_objects(
model_path, '/summarization/')
self._list_models_search = parse_objects(model_path, '/search/')
model_path, '/common/')
self._list_models_search = parse_objects(model_path, '/common/')

def _specs_to_yaml(self, title, task, custom, benchmarking, comparing, yaml_path):
"""
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.5",
"react-scripts": "5.0.1",
"react-scripts": "^3.0.1",
"react-use-websocket": "^3.0.0",
"redux": "^4.2.1",
"redux-thunk": "^2.4.2",
Expand Down
6 changes: 1 addition & 5 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@

import { SummarizationPage } from './pages/summarization/Summarization';
import { SearchPage } from './pages/search/Search';
import { BenchmarkPage } from './pages/benchmark/Benchmark';
import { ComparisionPage } from './pages/benchmark/Comparision';
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import store from './store';
import { BasePage } from './pages/BasePage';
Expand Down
13 changes: 4 additions & 9 deletions client/src/pages/BasePage.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { useState, useEffect } from "react";
import { useSelector, useDispatch } from "react-redux";

import { setConfig } from "../slice/configLoadSlice";

import { SearchPage } from "./search/Search";
import { SummarizationPage } from "./summarization/Summarization";

Expand All @@ -12,21 +10,18 @@ export function BasePage() {
React.useEffect(() => {
dispatch(setConfig());
}, []);
const config = useSelector((state) => state.config.config);

const config = useSelector((state) => state.config.config);
if (config == null) {
return <></>;
}

if (config["function"]["task"]==="search") {
if (config["function"]["task"][0]==="search") {
return <SearchPage config={config}/>
}

if (config["function"]["task"]==="summarization") {
if (config["function"]["task"][0]==="summarization") {
return <SummarizationPage config={config}/>
}



}

}
4 changes: 2 additions & 2 deletions client/src/pages/search/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { BenchmarkPage } from "./SearchBenchmark";
import { ComparisionPage } from "./SearchComparision";

export function SearchPage(props) {
const dispatch = useDispatch();

const config = useSelector((state) => state.config.config);
const func = useSelector((state) => state.functions.AppFunction);
console.log(config);
console.log(func);
if (config == null) {
return <></>;
}
Expand Down

0 comments on commit c5b0e17

Please sign in to comment.