Skip to content

Commit

Permalink
model info
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciroye committed Jul 21, 2023
1 parent ad1a061 commit 3d0069c
Show file tree
Hide file tree
Showing 22 changed files with 787 additions and 186 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Hi there

Your model $name has fail. Please check your model and try again. If you think this is a mistake, please contact
the task organizer.

Thanks,

The Dynabench Team
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Hi there

Your model $name has been successfully evaluate.
You can find and publish the model at https://dynabench.org/models/$model_id.

Thanks,

The Dynabench Team
35 changes: 27 additions & 8 deletions backend/app/domain/services/base/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,24 +333,43 @@ def upload_prediction_to_s3(
Key=model_path,
ContentType=predictions.content_type,
)
self.email_helper.send(
contact=user_email,
cc_contact="dynabench-site@mlcommons.org",
template_name="model_upload_successful.txt",
msg_dict={"name": model_name},
subject=f"Model {model_name} upload succeeded.",
)
centralize_host = os.getenv("CENTRALIZED_HOST")
endpoint = "/builder_evaluation/evaluation/evaluate_downstream_tasks"
url = f"{centralize_host}{endpoint}"
requests.post(
evaluate_model = requests.post(
url,
json={
"task_id": task_id,
"predictions": file_name,
"model_id": model["id"],
},
)
self.email_helper.send(
contact=user_email,
cc_contact="dynabench-site@mlcommons.org",
template_name="model_upload_successful.txt",
msg_dict={"name": model_name},
subject=f"Model {model_name} upload succeeded.",
)
if evaluate_model.status_code == 200:
self.email_helper.send(
contact=user_email,
cc_contact="dynabench-site@mlcommons.org",
template_name="model_evaluation_sucessful.txt",
msg_dict={"name": model_name, "model_id": model["id"]},
subject=f"Model {model_name} evaluation succeeded.",
)
else:
self.email_helper.send(
contact=user_email,
cc_contact="dynabench-site@mlcommons.org",
template_name="model_evaluation_fail.txt",
msg_dict={"name": model_name},
subject=f"Model {model_name} upload fail.",
)
raise HTTPException(
status_code=400, detail="Model evaluation fail, please try again"
)
return "Model evaluate successfully"

def conversation_with_buffer_memory(
Expand Down
103 changes: 93 additions & 10 deletions frontends/web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions frontends/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"bootstrap-switch-button-react": "^1.2.0",
"css-loader": "^3.6.0",
"downloadjs": "^1.4.7",
"formik": "^2.1.4",
"formik": "^2.4.2",
"framer-motion": "^10.11.2",
"highcharts": "^9.1.0",
"highcharts-react-official": "^3.0.0",
Expand Down Expand Up @@ -58,7 +58,8 @@
"style-loader": "^1.2.1",
"sweetalert2": "^11.6.14",
"typescript": "^4.9.5",
"use-http": "^1.0.27"
"use-http": "^1.0.27",
"yup": "^1.2.0"
},
"devDependencies": {
"@babel/core": "^7.10.5",
Expand Down
11 changes: 8 additions & 3 deletions frontends/web/src/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ import TasksPage from "../new_front/pages/Task/TasksPage";
import LoginPage from "new_front/pages/Login/LoginPage";
import MLCubeTutorial from "./MLCubeTutorial";
import ModelPage from "./ModelPage";
import ModelOverview from "new_front/pages/Model/ModelOverview";
import ProfilePage from "new_front/pages/ProfilePage/ProfilePage";
import RegisterPage from "./RegisterPage";
import Register from "new_front/pages/Login/Register";
import ResetPassword from "./ResetPassword";
import ScrollToTop from "./ScrollToTop.js";
import SubmitInterface from "./SubmitInterface.js";
Expand Down Expand Up @@ -485,7 +487,7 @@ class App extends React.Component {
/>
<Route
path="/tasks/:taskCode/models/:modelId"
component={ModelPage}
component={ModelOverview}
/>
<Route
path="/tasks/:taskCode/round/:roundId"
Expand Down Expand Up @@ -533,9 +535,12 @@ class App extends React.Component {
path="/task-owner-interface/:taskCode"
component={TaskOwnerPage}
/>
<Route path="/register" component={RegisterPage} />
<Route path="/register" component={Register} />
<Route path="/users/:userId" component={UserPage} />
<Route path="/models/:modelId" component={ModelPage} />
<Route
path="/models/:modelId"
component={ModelOverview}
/>
<Route path="/communities" component={TasksPage} />
<Route path="/" component={Landing} />
</Switch>
Expand Down
1 change: 1 addition & 0 deletions frontends/web/src/new_front/assets/register.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ type GeneralButtonProps = {
text: string;
className: string;
onClick: () => void;
disabled?: boolean;
};

const GeneralButton: FC<GeneralButtonProps> = ({
text,
className,
onClick,
disabled,
}) => {
return (
<Button className={className} onClick={onClick}>
<Button className={className} onClick={onClick} disabled={disabled}>
{text}
</Button>
);
Expand Down
Loading

0 comments on commit 3d0069c

Please sign in to comment.