msaid1976 commited on
Commit
ef19ec7
·
verified ·
1 Parent(s): 38c77ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -5,12 +5,17 @@ from chromadb.config import Settings
5
  from chromadb.utils import embedding_functions
6
  from sentence_transformers import SentenceTransformer
7
  import os
 
8
 
 
9
  api_token = os.getenv("HF_TOKEN")
10
 
11
  # Log in using the token
12
  login(api_token)
13
 
 
 
 
14
  # Load the Llama model using Hugging Face Transformers
15
  tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-chat-hf")
16
  model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-7b-chat-hf")
 
5
  from chromadb.utils import embedding_functions
6
  from sentence_transformers import SentenceTransformer
7
  import os
8
+ from huggingface_hub import login
9
 
10
+ # Retrieve the API token from the environment variable
11
  api_token = os.getenv("HF_TOKEN")
12
 
13
  # Log in using the token
14
  login(api_token)
15
 
16
+
17
+
18
+
19
  # Load the Llama model using Hugging Face Transformers
20
  tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-chat-hf")
21
  model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-7b-chat-hf")