Update human_text_detect.py
Browse files- human_text_detect.py +1 -2
human_text_detect.py
CHANGED
|
@@ -96,12 +96,11 @@ def detect_human_text(model_name, topic, text):
|
|
| 96 |
min_tokens_per_sentence = 10
|
| 97 |
max_tokens_per_sentence = 100
|
| 98 |
|
| 99 |
-
cache_dir = f"
|
| 100 |
|
| 101 |
# Init model
|
| 102 |
print('Init model')
|
| 103 |
lm_name = 'gpt2-xl' if model_name == 'GPT2XL' else 'microsoft/phi-2'
|
| 104 |
-
cache_dir = "/cache/huggingface"
|
| 105 |
tokenizer = AutoTokenizer.from_pretrained(lm_name, cache_dir=cache_dir)
|
| 106 |
|
| 107 |
print("Save tokenizer")
|
|
|
|
| 96 |
min_tokens_per_sentence = 10
|
| 97 |
max_tokens_per_sentence = 100
|
| 98 |
|
| 99 |
+
cache_dir = f"/.cache/huggingface/{model_name}"
|
| 100 |
|
| 101 |
# Init model
|
| 102 |
print('Init model')
|
| 103 |
lm_name = 'gpt2-xl' if model_name == 'GPT2XL' else 'microsoft/phi-2'
|
|
|
|
| 104 |
tokenizer = AutoTokenizer.from_pretrained(lm_name, cache_dir=cache_dir)
|
| 105 |
|
| 106 |
print("Save tokenizer")
|