mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Remote token output on startup
This commit is contained in:
parent
a93a79568d
commit
84989f0d05
@ -16,7 +16,6 @@ def get_clip_token_for_string(tokenizer, string):
|
|||||||
batch_encoding = tokenizer(string, truncation=True, max_length=77, return_length=True,
|
batch_encoding = tokenizer(string, truncation=True, max_length=77, return_length=True,
|
||||||
return_overflowing_tokens=False, padding="max_length", return_tensors="pt")
|
return_overflowing_tokens=False, padding="max_length", return_tensors="pt")
|
||||||
tokens = batch_encoding["input_ids"]
|
tokens = batch_encoding["input_ids"]
|
||||||
sys.stdout.write(f"tokeme: {tokens}")
|
|
||||||
assert torch.count_nonzero(tokens - 49407) == 2, f"String '{string}' maps to more than a single token. Please use another string"
|
assert torch.count_nonzero(tokens - 49407) == 2, f"String '{string}' maps to more than a single token. Please use another string"
|
||||||
|
|
||||||
return tokens[0, 1]
|
return tokens[0, 1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user