Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Better default for number of threads
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #659

Reviewed By: piotr-bojanowski

Differential Revision: D13318793

Pulled By: Celebio

fbshipit-source-id: 3b8fd28172b0291b2df93a526de630b01df680e8
  • Loading branch information
whiletruelearn authored and facebook-github-bot committed Dec 4, 2018
1 parent 7deac6d commit 501b9b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/fastText/FastText.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import fasttext_pybind as fasttext
import numpy as np
import multiprocessing

loss_name = fasttext.loss_name
model_name = fasttext.model_name
Expand Down Expand Up @@ -334,7 +335,7 @@ def train_supervised(
wordNgrams=1,
loss="softmax",
bucket=2000000,
thread=12,
thread=multiprocessing.cpu_count() - 1,
lrUpdateRate=100,
t=1e-4,
label="__label__",
Expand Down Expand Up @@ -375,7 +376,7 @@ def train_unsupervised(
wordNgrams=1,
loss="ns",
bucket=2000000,
thread=12,
thread=multiprocessing.cpu_count() -1,
lrUpdateRate=100,
t=1e-4,
label="__label__",
Expand Down

0 comments on commit 501b9b1

Please sign in to comment.