Abbeite commited on
Commit
fd4b875
·
verified ·
1 Parent(s): 8be321d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -20,19 +20,19 @@ from llama_index import VectorStoreIndex, download_loader
20
  from pathlib import Path
21
 
22
  # Define variable to hold llama2 weights naming
23
- name = "meta-llama/Llama-2-70b-chat-hf"
24
  # Set auth token variable from hugging face
25
- auth_token = "YOUR HUGGING FACE AUTH TOKEN HERE"
26
 
27
 
28
  @st.cache_resource
29
  def get_tokenizer_model():
30
  # Create tokenizer
31
- tokenizer = AutoTokenizer.from_pretrained(name, cache_dir='./model/', use_auth_token=auth_token)
32
 
33
  # Create model
34
  model = AutoModelForCausalLM.from_pretrained(name, cache_dir='./model/'
35
- , use_auth_token=auth_token, torch_dtype=torch.float16,
36
  rope_scaling={"type": "dynamic", "factor": 2}, load_in_8bit=True)
37
 
38
  return tokenizer, model
 
20
  from pathlib import Path
21
 
22
  # Define variable to hold llama2 weights naming
23
+ name = "NousResearch/Llama-2-7b-chat-hf"
24
  # Set auth token variable from hugging face
25
+
26
 
27
 
28
  @st.cache_resource
29
  def get_tokenizer_model():
30
  # Create tokenizer
31
+ tokenizer = AutoTokenizer.from_pretrained(name, cache_dir='./model/')
32
 
33
  # Create model
34
  model = AutoModelForCausalLM.from_pretrained(name, cache_dir='./model/'
35
+ , torch_dtype=torch.float16,
36
  rope_scaling={"type": "dynamic", "factor": 2}, load_in_8bit=True)
37
 
38
  return tokenizer, model