3244we commited on
Commit
5fe56ad
·
verified ·
1 Parent(s): d527051

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -1
README.md CHANGED
@@ -33,13 +33,14 @@ These models are only intended for the TruthfulQA evaluation.
33
 
34
  ```python
35
  import torch
 
36
  from transformers import AutoModelForCausalLM, AutoTokenizer
37
 
38
  model_id = "meta-llama/Meta-Llama-3-8B-Instruct"
39
  tokenizer = AutoTokenizer.from_pretrained(model_id)
40
  truth_judge = AutoModelForCausalLM.from_pretrained(model_id)
41
 
42
- custom_weights_path = "path_of_model/policy.pt"
43
  custom_state_dict = torch.hub.load_state_dict_from_url(custom_weights_path, map_location="cpu")
44
  truth_judge.load_state_dict(custom_state_dict['state'])
45
 
 
33
 
34
  ```python
35
  import torch
36
+ from huggingface_hub import hf_hub_download
37
  from transformers import AutoModelForCausalLM, AutoTokenizer
38
 
39
  model_id = "meta-llama/Meta-Llama-3-8B-Instruct"
40
  tokenizer = AutoTokenizer.from_pretrained(model_id)
41
  truth_judge = AutoModelForCausalLM.from_pretrained(model_id)
42
 
43
+ custom_weights_path = hf_hub_download(repo_id="3244we/Llama-3-8B-Instruct-Truthfulqa-Truth-Judge", filename="policy.pt", repo_type="model")
44
  custom_state_dict = torch.hub.load_state_dict_from_url(custom_weights_path, map_location="cpu")
45
  truth_judge.load_state_dict(custom_state_dict['state'])
46