proitm commited on
Commit
4d831fe
·
verified ·
1 Parent(s): 15664ca

Added fix to prompt and profile passing

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -45,7 +45,7 @@ class BasicAgent:
45
  def __call__(self, question: str) -> str:
46
  print(f"\nAgent (smolagents) received question (first 100 chars): {question[:100]}...")
47
  try:
48
- prompt = f"Answer the following question without any formatting. Just plain text answer with no reasoning output. ${question}"
49
  response = self.agent_executor.run(question)
50
 
51
  print(f"Agent (smolagents) returning answer (first 50 chars): {str(response)[:50]}...")
@@ -65,6 +65,10 @@ async def run_and_submit_all(profile: gr.OAuthProfile | None):
65
  questions_url = f"{api_url}/questions"
66
  submit_url = f"{api_url}/submit"
67
 
 
 
 
 
68
  # 1. Instantiate Agent ( modify this part to create your agent)
69
  try:
70
  agent = BasicAgent()
 
45
  def __call__(self, question: str) -> str:
46
  print(f"\nAgent (smolagents) received question (first 100 chars): {question[:100]}...")
47
  try:
48
+ prompt = f"Answer the following question without formatting, reasoning or explanation. ${question}"
49
  response = self.agent_executor.run(question)
50
 
51
  print(f"Agent (smolagents) returning answer (first 50 chars): {str(response)[:50]}...")
 
65
  questions_url = f"{api_url}/questions"
66
  submit_url = f"{api_url}/submit"
67
 
68
+ if profile:
69
+ username= f"{profile.username}"
70
+ print(f"User logged in: {username}")
71
+
72
  # 1. Instantiate Agent ( modify this part to create your agent)
73
  try:
74
  agent = BasicAgent()