Skip to content

Commit bffb320

Browse files
authored
Merge pull request #858 from epfml/interactive-tutorial-olena
Add interactive tutorial guide to enhance user experience
2 parents d341dbd + 9cb8984 commit bffb320

File tree

27 files changed

+372
-91
lines changed

27 files changed

+372
-91
lines changed

datasets/populate

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ rm archive.zip DeAI-testimages
1717

1818
# wikitext
1919
mkdir -p wikitext
20-
curl 'https://dax-cdn.cdn.appdomain.cloud/dax-wikitext-103/1.0.1/wikitext-103.tar.gz' |
21-
tar --extract --gzip --strip-components=1 -C wikitext
20+
curl 'https://storage.googleapis.com/deai-313515.appspot.com/wikitext.zip' > wikitext.zip
21+
unzip -u wikitext.zip
22+
rm wikitext.zip
2223

2324
# tinder_dog
2425
curl 'https://storage.googleapis.com/deai-313515.appspot.com/tinder_dog.zip' > tinder_dog.zip

discojs/src/default_tasks/wikitext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const wikitext: TaskProvider<'text'> = {
2020
].join(" "),
2121
dataFormatInformation: 'You can use any natural language (text) dataset you like. For example the Wikitext-103 dataset is organized as a large text file, with each line representing a segment of raw text from Wikipedia articles.',
2222
dataExampleText: 'An example excerpt from the dataset is: <i>"For the first twenty years of its existence , the only staged performances of Parsifal took place in the Bayreuth Festspielhaus , the venue for which Wagner conceived the work ( except eight private performances for Ludwig II at Munich in 1884 and 1885 ) ."</i>',
23-
sampleDatasetLink: 'https://dax-cdn.cdn.appdomain.cloud/dax-wikitext-103/1.0.1/wikitext-103.tar.gz',
23+
sampleDatasetLink: 'https://storage.googleapis.com/deai-313515.appspot.com/wikitext.zip',
2424
sampleDatasetInstructions: 'Opening the link should start downloading a zip file. Unzip it and drag and drop the training set named "wiki.train.tokens" in the field below (or use the "Select File" button). Even though the file extension is ".tokens" it is indeed a text file. You can use "wiki.test.tokens" at the evaluation step after training a language model.'
2525
},
2626
trainingInformation: {

package-lock.json

Lines changed: 10 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webapp/cypress/e2e/datasetInput.cy.ts

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ import { basicTask, setupServerWith } from "../support/e2e";
33
// TODO move to components testing
44
// upstream doesn't yet allow that vuejs/test-utils#2468
55

6+
function goToDatasetInputStep() {
7+
cy.visit("/#/list");
8+
cy.get(".driver-popover-close-btn").click();
9+
cy.get("button").contains("participate").click();
10+
cy.get("button").contains("next").click();
11+
}
12+
613
describe("image dataset input by group", () => {
714
it("shows passed labels", () => {
815
setupServerWith(
@@ -14,11 +21,7 @@ describe("image dataset input by group", () => {
1421
}),
1522
);
1623

17-
cy.visit("/#/list");
18-
cy.get("button").contains("participate").click();
19-
20-
cy.get("button").contains("next").click();
21-
24+
goToDatasetInputStep();
2225
cy.get("button").contains("group").click();
2326

2427
cy.contains("Group label: first").should("exist");
@@ -36,11 +39,7 @@ describe("image dataset input by group", () => {
3639
}),
3740
);
3841

39-
cy.visit("/#/list");
40-
cy.get("button").contains("participate").click();
41-
42-
cy.get("button").contains("next").click();
43-
42+
goToDatasetInputStep();
4443
cy.get("button").contains("group").click();
4544
cy.contains("select images").selectFile([
4645
{ fileName: "first.png", contents: new Uint8Array() },
@@ -63,11 +62,7 @@ describe("image dataset input by csv", () => {
6362
}),
6463
);
6564

66-
cy.visit("/#/list");
67-
cy.get("button").contains("participate").click();
68-
69-
cy.get("button").contains("next").click();
70-
65+
goToDatasetInputStep();
7166
cy.get("button").contains("csv").click();
7267
cy.contains("select CSV").selectFile({
7368
fileName: "csv",
@@ -99,11 +94,7 @@ describe("tabular dataset input", () => {
9994
}),
10095
);
10196

102-
cy.visit("/#/list");
103-
cy.get("button").contains("participate").click();
104-
105-
cy.get("button").contains("next").click();
106-
97+
goToDatasetInputStep();
10798
cy.contains("select CSV").selectFile({
10899
fileName: "filename",
109100
contents: new TextEncoder().encode("a,b,c\n1,2,3\n"),

webapp/cypress/e2e/store/models.cy.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { defaultTasks } from "@epfml/discojs";
22

33
import { setupServerWith } from "../../support/e2e";
44

5-
it("stores models", () => {
5+
it("stores models",
6+
{ retries: 5 }, // can exhaust memory
7+
() => {
68
setupServerWith(defaultTasks.titanic);
79

810
cy.visit("/#/evaluate");
@@ -13,7 +15,9 @@ it("stores models", () => {
1315
cy.contains("button", "test").should("exist");
1416
});
1517

16-
it("stores larger models", () => {
18+
it("stores larger models",
19+
{ retries: 5 }, // can exhaust memory
20+
() => {
1721
setupServerWith(defaultTasks.wikitext);
1822

1923
cy.visit("/#/evaluate");

webapp/cypress/e2e/tasks.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe("tasks page", () => {
1919
setupServerWith(defaultTasks.titanic);
2020

2121
cy.visit("/#/list").contains("button", "participate");
22-
22+
cy.get(".driver-popover-close-btn").click();
2323
cy.get(`div[id="titanic"]`).find("button").click();
2424
cy.url().should("eq", `${Cypress.config().baseUrl}#/titanic`);
2525

webapp/cypress/e2e/testing.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ it("can test lus_covid", () => {
4141
.contains("button", "test")
4242
.click();
4343

44-
cy.contains("button", "download as csv", { timeout: 10_000 });
44+
cy.contains("button", "download as csv", { timeout: 20_000 });
4545
});
4646

4747
it("can start and stop testing of wikitext", () => {

webapp/cypress/e2e/training.cy.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ import { defaultTasks } from "@epfml/discojs";
22

33
import { setupServerWith } from "../support/e2e";
44

5+
function goToTaskOverview() {
6+
cy.visit("/");
7+
cy.contains("a", "Start training").click();
8+
cy.get(".driver-popover-close-btn").click();
9+
cy.contains("button", "participate").click();
10+
}
11+
512
describe("training page", () => {
613
it("is navigable", () => {
714
setupServerWith(defaultTasks.titanic);
815

9-
cy.visit("/");
10-
11-
cy.contains("a", "Start training").click();
12-
cy.contains("button", "participate").click();
16+
goToTaskOverview();
1317

1418
const navigationButtons = 3;
1519
for (let i = 0; i < navigationButtons; i++) {
@@ -23,10 +27,7 @@ describe("training page", () => {
2327
it("can train titanic", () => {
2428
setupServerWith(defaultTasks.titanic);
2529

26-
cy.visit("/");
27-
28-
cy.contains("a", "Start training").click();
29-
cy.contains("button", "participate").click();
30+
goToTaskOverview();
3031
cy.contains("button", "next").click();
3132

3233
cy.contains("label", "select CSV").selectFile(
@@ -52,10 +53,7 @@ describe("training page", () => {
5253
// throwing to stop training
5354
cy.on("uncaught:exception", (e) => !e.message.includes("stop training"));
5455

55-
cy.visit("/");
56-
57-
cy.contains("a", "Start training").click();
58-
cy.contains("button", "participate").click();
56+
goToTaskOverview();
5957
cy.contains("button", "next").click();
6058

6159
cy.task<string[]>("readdir", "../datasets/lus_covid/COVID+/").then(

webapp/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"apexcharts": "4",
1818
"cypress": "14",
1919
"d3": "7",
20+
"driver.js": "1",
2021
"pinia": "<2.2.3",
2122
"pinia-plugin-persistedstate-2": "2",
2223
"vee-validate": "4",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<template>
2+
<svg
3+
xmlns="http://www.w3.org/2000/svg"
4+
fill="currentColor"
5+
class="w-6 h-6"
6+
viewBox="-60 0 512 512"
7+
stroke="currentColor"
8+
>
9+
<path
10+
d="M80 160c0-35.3 28.7-64 64-64h32c35.3 0 64 28.7 64 64v3.6c0 21.8-11.1 42.1-29.4 53.8l-42.2 27.1c-25.2 16.2-40.4 44.1-40.4 74v1.4c0 17.7 14.3 32 32 32s32-14.3 32-32v-1.4c0-8.2 4.2-15.8 11-20.2l42.2-27.1c36.6-23.6 58.8-64.1 58.8-107.7V160c0-70.7-57.3-128-128-128H144C73.3 32 16 89.3 16 160c0 17.7 14.3 32 32 32s32-14.3 32-32zm80 320a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"
11+
/>
12+
</svg>
13+
</template>

0 commit comments

Comments
 (0)