Penality commited on
Commit
10a8f5e
·
verified ·
1 Parent(s): a06984f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -15,6 +15,12 @@ load_dotenv()
15
  # Set up Together.AI API Key (Replace with your actual key)
16
  assert os.getenv("TOGETHER_API_KEY"), "api key missing"
17
 
 
 
 
 
 
 
18
 
19
  # Load LLaMA-2 Model
20
  llama_pipe = pipeline("text-generation", model="meta-llama/Llama-2-7b-chat-hf")
 
15
  # Set up Together.AI API Key (Replace with your actual key)
16
  assert os.getenv("TOGETHER_API_KEY"), "api key missing"
17
 
18
+ # Retrieve the API token from secrets
19
+ api_token = os.getenv("HUGGINGFACEHUB_API_TOKEN")
20
+
21
+ if api_token:
22
+ login(api_token) # Authenticate with Hugging Face
23
+
24
 
25
  # Load LLaMA-2 Model
26
  llama_pipe = pipeline("text-generation", model="meta-llama/Llama-2-7b-chat-hf")