diff --git a/src/predict.js b/src/predict.js index 4452fc8..9428542 100644 --- a/src/predict.js +++ b/src/predict.js @@ -8,7 +8,10 @@ const classifierModelPromise = tf.loadLayersModel(MODEL_URL); // This value greatly affects RAM usage due to USE // Higher values will tend to yield better performance, but higher RAM usage -const SENTENCE_EMBEDDING_BATCH_SIZE = parseInt(process.env.SENTENCE_EMBEDDING_BATCH_SIZE || 200, 10); +const SENTENCE_EMBEDDING_BATCH_SIZE = parseInt( + process.env.SENTENCE_EMBEDDING_BATCH_SIZE || 200, + 10, +); const predict = async (sentences) => { const useModel = await usePromise; diff --git a/src/server.js b/src/server.js index a896fb5..4ae36c6 100644 --- a/src/server.js +++ b/src/server.js @@ -15,7 +15,7 @@ app.use(express.json()); const PREDICTION_CONCURRENCY = parseInt(process.env.PREDICTION_CONCURRENCY || os.cpus().length, 10); const queue = new PQueue({ - concurrency: PREDICTION_CONCURRENCY + concurrency: PREDICTION_CONCURRENCY, }); app.post('/', async (req, res) => {