@@ -99,45 +99,14 @@ class Train {
9999 return model
100100 }
101101
102- async sleep ( ms ) {
103- return new Promise ( resolve => setTimeout ( resolve , ms ) ) ;
104- }
105-
106102 // Retrieve the data needed
107103 async prepareData ( ) {
108- console . log ( "Preparing data..." ) ;
109- await this . sleep ( 1000 ) ;
110-
111- // Write a beautiful terminal message logging training
112- // vilsonrodrigues/falcon-7b-instruct-sharded and loading animation
113-
114-
115- // after 10 seconds, stop animation
116- // setTimeout(function () {
117- // clearInterval(handle);
118- // console.log("\nConnecting to http://127.0.0.1:5000")
119- // }, 2000);
120-
121- // start loading animation: logging training vilsonrodrigues/falcon-7b-instruct-sharded
122- const handle = loadAnimation ( "Finetuning vilsonrodrigues/falcon-7b-instruct-sharded" ) ;
123-
124- await this . sleep ( 20000 ) ;
125- return
126104 if ( this . verbose ) console . log ( 'DriveTrain:PrepareData()' ) ;
127105 let inp = this . input = await this . getData ( 'input' ) ;
128106 let out = this . output = await this . getData ( 'output' ) ;
129107
130108 // console.log('DriveTrain:PrepareData:inp', inp, out)
131109
132- /**
133-
134- langdrive train --csv $PWD/trainingData.csv
135- --hfModelPath vilsonrodrigues/falcon-7b-instruct-sharded
136- --hfToken $HF_TOKEN
137- --deployToHf true
138-
139- */
140-
141110 // create a new array of objects with the input and output data
142111 let data = this . data = inp . map ( ( input , i ) => { return { input : inp [ i ] , output : out [ i ] } } )
143112
@@ -244,21 +213,3 @@ module.exports = Train;
244213// We dont have a service to work with local files atm.
245214// for csvs set 'csv' as service (optionally,atm) and 'path' as path (required)
246215// be explicitly clear that the cli args overwrite the yaml file.
247-
248- function loadAnimation ( text ) {
249-
250- // frame sequence
251- const frames = [ '\\' , '|' , '/' , '-' ] ;
252- let current = 0 ;
253-
254- // return function that when called will move to the next frame
255- return setInterval ( function ( ) {
256- // print text + 'loading' animation
257- readline . clearLine ( process . stdout , 0 ) ;
258- readline . cursorTo ( process . stdout , 0 ) ;
259- process . stdout . write ( text + ' ' + frames [ current ++ ] ) ;
260-
261- // if it's at the end of frames array, loop back to start
262- current = current % frames . length ;
263- } , 500 ) ; // interval between frames - 500ms
264- }
0 commit comments