r1208 commited on
Commit
94ab360
·
verified ·
1 Parent(s): 5b2e38d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -14,6 +14,7 @@ text_default = """
14
 
15
  수만의 몬스터로 이루어진 검은 파도가 갈라졌다. 초고온의 열기가 살과 뼈를 태우고 지면을 녹였다."""
16
 
 
17
 
18
  from peft import AutoPeftModelForCausalLM
19
  from transformers import AutoTokenizer
@@ -27,10 +28,10 @@ import torch
27
 
28
  model_id = "r1208/c4ai-command-r-v01-4bit_32r"
29
 
30
- model = AutoPeftModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16)
31
- tokenizer = AutoTokenizer.from_pretrained(model_id, token = access_token)
32
 
33
- tokenizer_with_prefix_space = AutoTokenizer.from_pretrained(model_id, add_prefix_space=True)
34
 
35
  def get_tokens_as_list(word_list):
36
  "Converts a sequence of words into a list of tokens"
 
14
 
15
  수만의 몬스터로 이루어진 검은 파도가 갈라졌다. 초고온의 열기가 살과 뼈를 태우고 지면을 녹였다."""
16
 
17
+ hf_token = os.getenv("HF_ACCESS_TOKEN")
18
 
19
  from peft import AutoPeftModelForCausalLM
20
  from transformers import AutoTokenizer
 
28
 
29
  model_id = "r1208/c4ai-command-r-v01-4bit_32r"
30
 
31
+ model = AutoPeftModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, use_auth_token=hf_token)
32
+ tokenizer = AutoTokenizer.from_pretrained(model_id, token = access_token, use_auth_token=hf_token)
33
 
34
+ tokenizer_with_prefix_space = AutoTokenizer.from_pretrained(model_id, add_prefix_space=True, use_auth_token=hf_token)
35
 
36
  def get_tokens_as_list(word_list):
37
  "Converts a sequence of words into a list of tokens"