diff --git a/README.md b/README.md index 5d3b5a0..78cb7c1 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # bert-vits vits with bert + +put [pytorch_model.bin](https://huggingface.co/hfl/chinese-roberta-wwm-ext-large/resolve/main/pytorch_model.bin) +to bert/roberta_wwm_ext_large/ diff --git a/text/chinese_bert.py b/text/chinese_bert.py index 2e0bd0f..cb84ce0 100644 --- a/text/chinese_bert.py +++ b/text/chinese_bert.py @@ -1,15 +1,10 @@ import torch from transformers import AutoTokenizer, AutoModelForMaskedLM -import os - -os.environ['ALL_PROXY']='socks5://127.0.0.1:7890' -os.environ['HTTPS_PROXY']='http://127.0.0.1:7890' -os.environ['HTTP_PROXY']='http://127.0.0.1:7890' device = torch.device("cuda" if torch.cuda.is_available() else "cpu") -tokenizer = AutoTokenizer.from_pretrained("hfl/chinese-roberta-wwm-ext-large") -model = AutoModelForMaskedLM.from_pretrained("hfl/chinese-roberta-wwm-ext-large").to(device) +tokenizer = AutoTokenizer.from_pretrained("./bert/chinese-roberta-wwm-ext-large") +model = AutoModelForMaskedLM.from_pretrained("./bert/chinese-roberta-wwm-ext-large").to(device) def get_bert_feature(text, word2ph): with torch.no_grad():