question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dear @loretoparisi I installed your fasttext.js in order to solve memory problem that we discus about in https://github.com/facebookresearch/fastText/issues/276#issuecomment-337320249

Now when i run : node fasttext_predict.js it take like 5 sec to load the module,

"use strict";

(function() {

var DATA_ROOT='./data';

var FastText = require('./fasttext.js/lib/index');
var fastText = new FastText({
    loadModel: DATA_ROOT + '/model_gender.bin' // must specifiy filename and ext
});

var sample="Bashar Al Masri";
fastText.load()
.then(done => {
    return fastText.predict(sample);
})
.then(labels=> {
    console.log("TEXT:", sample, "\nPREDICT:",labels );
    sample="Hisahm al mjude";
    return fastText.predict(sample);
})
.then(labels=> {
    console.log("TEXT:", sample, "\nPREDICT:",labels );
   fastText.unload();
})
.catch(error => {
    console.error("predict error",error);
});

}).call(this);

and It return to stdout the prediction and exit , due to fastText.unload(); Now i need to call this file “node fasttext_predict.js UserName” from any place passing some args [UserName] to it and return to the stdout the result directly , since you saide it will be loaded into memory , in order to be able to get this result from the php webserver.

It is the same problem with the C++ file loading , i need it to be run in the background !

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
myoldusernamecommented, Oct 19, 2017

It is working as expected , THANK YOU SO MUCH . You made my day !

Can i send you a donation ?

0reactions
loretoparisicommented, Nov 3, 2017

I have added here some benchmarkes therefore I’m closing this issue. Feel free to re-open it if you have any problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How a program is loaded into memory and then executed?
A program is a pile of bits. A file is a pile of bits. The way a program is loaded into memory is...
Read more >
How to efficiently load data to memory | by Jorge C. Leitão
The first section introduces what loading data to memory is composed of; The second and third sections go through each of the components...
Read more >
How process loaded into memory? [duplicate] - Super User
A program (or data) can be loaded into memory. A process is started/created to execute that program. A filesystem address is what "point[s]...
Read more >
How to load a file into memory? : r/C_Programming - Reddit
Open the file for reading. Open a temporary file for writing in the same directory. Read the first file line by line and...
Read more >
In C, Is there a way to load array into memory when need?
I guess this means all tables is loaded to memory right. Yes, that's correct. In your code the tables are global variables.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found