KUAN-HSUN-LI commented on a change in pull request #812:
URL: https://github.com/apache/submarine/pull/812#discussion_r758926266
##########
File path:
submarine-workbench/workbench-web/src/app/pages/workbench/model/model-home/model-home.component.ts
##########
@@ -38,80 +39,23 @@ export class ModelHomeComponent implements OnInit {
listOfChosenTags = [];
ngOnInit() {
- this.modelCards = [
- {
- 'name': "Model One",
- 'createTime': "2021-10-12",
- 'updatedTime': "2021-10-13",
- 'tags': ["image", 'text'],
- 'description': "first model",
- },
- {
- 'name': "Model Two",
- 'createTime': "2021-10-12",
- 'updatedTime': "2021-10-13",
- 'tags': ["speech"],
- 'description': "second model",
- },
- {
- 'name': "Model Three",
- 'createTime': "2021-10-12",
- 'updatedTime': "2021-10-13",
- 'tags': ["speech"],
- 'description': "The third model has very long description for
description shorten testing, 1234567890 A recurrent neural network (RNN) is a
class of artificial neural networks where connections between nodes form a
directed graph along a temporal sequence. This allows it to exhibit temporal
dynamic behavior. Derived from feedforward neural networks, RNNs can use their
internal state (memory) to process variable length sequences of inputs",
- },
- {
- 'name': "ModelFour",
- 'createTime': "2021-10-18",
- 'updatedTime': "2021-10-19",
- 'tags': ["nlp", 'ssl'],
- 'description': "BERT, a famous ssl model in NLP.",
- },
- {
- 'name': "ModelFive",
- 'createTime': "2021-10-18",
- 'updatedTime': "2021-10-19",
- 'tags': ["speech", 'ssl'],
- 'description': "huBERT, a famous ssl model in SP.",
- },
- {
- 'name': "ModelSix",
- 'createTime': "2021-10-18",
- 'updatedTime': "2021-10-19",
- 'tags': ["CV", 'ssl'],
- 'description': "SimCLR, a famous ssl model in CV.",
- },
- {
- 'name': "ModelFour",
- 'createTime': "2021-10-18",
- 'updatedTime': "2021-10-19",
- 'tags': ["nlp", 'ssl'],
- 'description': "BERT, a famous ssl model in NLP.",
- },
- {
- 'name': "ModelFive",
- 'createTime': "2021-10-18",
- 'updatedTime': "2021-10-19",
- 'tags': ["speech", 'ssl'],
- 'description': "huBERT, a famous ssl model in SP.",
- },
- {
- 'name': "ModelSix",
- 'createTime': "2021-10-18",
- 'updatedTime': "2021-10-19",
- 'tags': ["CV", 'ssl'],
- 'description': "SimCLR, a famous ssl model in CV.",
- },
- ];
-
- this.onDisplayModelCards = this.modelCards.map(card => card);
- let tags = [];
- this.modelCards.map((card) => {
- Array.prototype.push.apply(tags, card.tags);
+ this.fetchModelCards();
+ this.modelService.emitInfo(null);
+ }
+
+ fetchModelCards = () => {
+ this.modelService.fetchModelList().subscribe((res) => {
+ this.modelCards = res;
+ this.onDisplayModelCards = this.modelCards.map(card => card);
+ let tags = [];
+ this.modelCards.map((card) => {
+ Array.prototype.push.apply(tags, card.tags);
+ });
+ let tags_set = new Set(tags);
+ tags = Array.from(tags_set);
Review comment:
`let tags_set = new Set();`
`this.modelCards.map((card) => {
tags_set.add(card.tags);
});`
`tags = Array.from(tags_set);`
This is what I mean. Is this feasible?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]