File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -10,14 +10,14 @@ Word2Vec
10
10
import * as tf from '@tensorflow/tfjs' ;
11
11
12
12
class Word2Vec {
13
- constructor ( vectors , callback ) {
13
+ constructor ( model , callback ) {
14
14
this . ready = false ;
15
15
this . model = { } ;
16
16
this . modelSize = 0 ;
17
- this . loadVectors ( vectors , callback ) ;
17
+ this . loadModel ( model , callback ) ;
18
18
}
19
19
20
- loadVectors ( file , callback ) {
20
+ loadModel ( file , callback ) {
21
21
fetch ( file )
22
22
. then ( response => response . json ( ) )
23
23
. then ( ( json ) => {
@@ -105,4 +105,6 @@ class Word2Vec {
105
105
}
106
106
}
107
107
108
- export default Word2Vec ;
108
+ const word2vec = ( model , cb = ( ) => { } ) => new Word2Vec ( model , cb ) ;
109
+
110
+ export default word2vec ;
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import * as tf from '@tensorflow/tfjs';
7
7
import pitchDetection from './PitchDetection/' ;
8
8
import imageClassifier from './ImageClassifier/' ;
9
9
import featureExtractor from './FeatureExtractor/' ;
10
- import Word2Vec from './Word2vec/' ;
10
+ import word2vec from './Word2vec/' ;
11
11
import YOLO from './YOLO' ;
12
12
import poseNet from './PoseNet' ;
13
13
import * as imageUtils from './utils/imageUtilities' ;
@@ -19,7 +19,7 @@ module.exports = {
19
19
featureExtractor,
20
20
pitchDetection,
21
21
YOLO ,
22
- Word2Vec ,
22
+ word2vec ,
23
23
styleTransfer,
24
24
poseNet,
25
25
LSTMGenerator,
You can’t perform that action at this time.
0 commit comments