idkash1 commited on
Commit
e135674
·
verified ·
1 Parent(s): 95088a5

Update human_text_detect.py

Browse files
Files changed (1) hide show
  1. human_text_detect.py +2 -2
human_text_detect.py CHANGED
@@ -100,8 +100,8 @@ def detect_human_text(model_name, topic, text):
100
  print('Init model')
101
  lm_name = 'gpt2-xl' if model_name == 'GPT2XL' else 'microsoft/phi-2'
102
  cache_dir = "/cache/huggingface"
103
- tokenizer = AutoTokenizer.from_pretrained(lm_name, cache_dir=cache_dir, local_files_only=True)
104
- model = AutoModelForCausalLM.from_pretrained(lm_name, cache_dir=cache_dir, local_files_only=True)
105
 
106
  print('Init PerplexityEvaluator')
107
  sentence_detector = PerplexityEvaluator(model, tokenizer)
 
100
  print('Init model')
101
  lm_name = 'gpt2-xl' if model_name == 'GPT2XL' else 'microsoft/phi-2'
102
  cache_dir = "/cache/huggingface"
103
+ tokenizer = AutoTokenizer.from_pretrained(lm_name, cache_dir=cache_dir)
104
+ model = AutoModelForCausalLM.from_pretrained(lm_name, cache_dir=cache_dir)
105
 
106
  print('Init PerplexityEvaluator')
107
  sentence_detector = PerplexityEvaluator(model, tokenizer)