Update app.py
Browse files
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 = "
|
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 |
-
,
|
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
|