Sign inSign up

pbaumgartner/pytorch-bert

By pbaumgartner

•Updated over 7 years ago

Images for use with the pretrained pytorch BERT models

Image
1

443

Dockerfile
FROM anibali/pytorch:no-cuda
RUN sudo apt-get update --fix-missing && sudo apt-get install --fix-missing -y \
    build-essential \
    gcc 
RUN conda install notebook==5.7.4 pandas==0.24.1
RUN pip install pytorch-pretrained-bert==0.6.1 Click==7.0
RUN python -c "from pytorch_pretrained_bert.tokenization import BertTokenizer; BertTokenizer.from_pretrained('bert-base-uncased', cache_dir='/home/user/.pytorch_pretrained_bert')"
RUN python -c "from pytorch_pretrained_bert.modeling import BertForSequenceClassification; BertForSequenceClassification.from_pretrained('bert-base-uncased', cache_dir='/home/user/.pytorch_pretrained_bert', num_labels=2)"
CMD ["bash"]