Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 652 Bytes

README.md

File metadata and controls

31 lines (20 loc) · 652 Bytes

fasttext_fastapi

A simple API for some of the fasttext functions

  1. install miniconda

  2. create env

conda env create -f environment.yml

and activate env

  1. download model
python3 -c "import fasttext.util; fasttext.util.download_model('en', if_exists='ignore')  # English 300 dim cc vecs"
  1. run uvicorn with the COMPRESS_FASTTEXT flag
COMPRESS_FASTTEXT=false uvicorn src.main:app --workers 1 --host 0.0.0.0 --port 8080
  1. open another shell and run:
curl "http:/0.0.0.0:8080/get_word_neighbors/" -H "Content-Type: application/json" --data '{"word":"hey","neighbors":500,"dropstrange":true}'