mirror of
https://github.com/arc53/DocsGPT.git
synced 2026-02-24 21:31:05 +00:00
Update application files and fix LLM models, create new retriever class
This commit is contained in:
6
application/utils.py
Normal file
6
application/utils.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from transformers import GPT2TokenizerFast
|
||||
|
||||
|
||||
def count_tokens(string):
|
||||
tokenizer = GPT2TokenizerFast.from_pretrained('gpt2')
|
||||
return len(tokenizer(string)['input_ids'])
|
||||
Reference in New Issue
Block a user