shovan777 commited on
Commit
c60c0eb
·
1 Parent(s): 81917a3

Retrieve access to llm.

Browse files
Files changed (2) hide show
  1. .gitignore +1 -0
  2. app.py +4 -1
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ .env*
app.py CHANGED
@@ -12,7 +12,10 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
12
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
13
  class BasicAgent:
14
  def __init__(self):
15
- print("BasicAgent initialized.")
 
 
 
16
  def __call__(self, question: str) -> str:
17
  print(f"Agent received question (first 50 chars): {question[:50]}...")
18
  fixed_answer = "This is a default answer."
 
12
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
13
  class BasicAgent:
14
  def __init__(self):
15
+ # get llm access token from env variable from local env or from hugging face secrets
16
+ # (this is not the best way to do it, but it is the easiest for now)
17
+ self.llm_access_token = os.getenv("LLM_ACCESS_TOKEN")
18
+ print(f"BasicAgent initialized.{self.llm_access_token[:3]}")
19
  def __call__(self, question: str) -> str:
20
  print(f"Agent received question (first 50 chars): {question[:50]}...")
21
  fixed_answer = "This is a default answer."