Fix a few last paths for the new repo org (#8666)

This commit is contained in:
Sylvain Gugger
2020-11-19 11:56:42 -05:00
committed by GitHub
parent a79a96ddaa
commit cb3e5c33f7
5 changed files with 10 additions and 6 deletions

View File

@@ -3,7 +3,7 @@ import json
from typing import List
from ltp import LTP
from transformers.tokenization_bert import BertTokenizer
from transformers import BertTokenizer
def _is_chinese_char(cp):

View File

@@ -107,7 +107,12 @@ def make_support(question, source="wiki40b", method="dense", n_results=10):
return question_doc, support_list
@st.cache(hash_funcs={torch.Tensor: (lambda _: None), transformers.tokenization_bart.BartTokenizer: (lambda _: None)})
@st.cache(
hash_funcs={
torch.Tensor: (lambda _: None),
transformers.models.bart.tokenization_bart.BartTokenizer: (lambda _: None),
}
)
def answer_question(
question_doc, s2s_model, s2s_tokenizer, min_len=64, max_len=256, sampling=False, n_beams=2, top_p=0.95, temp=0.8
):