"...source/git@developer.sourcefind.cn:Wenxuan/LightX2V.git" did not exist on "749f8c64ef0494a06f0c3b2ea5e30ac0cfa7be89"
Unverified Commit ebe9e6b9 authored by sdtblck's avatar sdtblck Committed by GitHub
Browse files

Update gpt2.py

parent a14adbe0
...@@ -71,10 +71,8 @@ class GPT2LM(LM): ...@@ -71,10 +71,8 @@ class GPT2LM(LM):
loglikelihoods = [] loglikelihoods = []
with torch.no_grad(): with torch.no_grad():
for string, in tqdm(requests): for string, in tqdm(requests):
encoded = self.tokenizer.encode_plus(string)["input_ids"]
rolling_token_windows = list(map(utils.make_disjoint_window, utils.get_rolling_token_windows( rolling_token_windows = list(map(utils.make_disjoint_window, utils.get_rolling_token_windows(
token_list=encoded, token_list=self.tokenizer.encode(string),
prefix_token=self.EOT_TOKEN_ID, prefix_token=self.EOT_TOKEN_ID,
max_seq_len=self.max_length, max_seq_len=self.max_length,
context_len=1, context_len=1,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment