tsumarios commited on
Commit
1fd3716
·
verified ·
1 Parent(s): b7ad2a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -9,12 +9,21 @@ import pandas as pd
9
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
10
  LLM_MODEL_URL = "https://api-inference.huggingface.co/models/google/flan-ul2"
11
 
 
12
  # --- Awesome Agent Definition ---
13
  class AwesomeAgent:
 
 
14
  def __init__(self):
15
  self.api_token = os.getenv("HF_TOKEN")
16
  self.api_url = LLM_MODEL_URL
 
 
 
 
17
  print("AwesomeAgent initialized.")
 
 
18
  def __call__(self, question: str) -> str:
19
  print(f"Agent received question (first 50 chars): {question[:50]}...")
20
  prompt = f"Answer the following question as clearly and accurately as possible:\n\n{question.strip()}"
 
9
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
10
  LLM_MODEL_URL = "https://api-inference.huggingface.co/models/google/flan-ul2"
11
 
12
+
13
  # --- Awesome Agent Definition ---
14
  class AwesomeAgent:
15
+
16
+
17
  def __init__(self):
18
  self.api_token = os.getenv("HF_TOKEN")
19
  self.api_url = LLM_MODEL_URL
20
+ self.headers = {
21
+ "Authorization": f"Bearer {self.api_token}",
22
+ "Content-Type": "application/json"
23
+ }
24
  print("AwesomeAgent initialized.")
25
+
26
+
27
  def __call__(self, question: str) -> str:
28
  print(f"Agent received question (first 50 chars): {question[:50]}...")
29
  prompt = f"Answer the following question as clearly and accurately as possible:\n\n{question.strip()}"