Bhanu-Chander-ABB commited on
Commit
997a3ca
·
1 Parent(s): 75c9b07

modify time limit in agents

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -300,8 +300,8 @@ You have access to a set of tools that you can use to answer the question:
300
 
301
  {tool_descriptions}
302
 
303
- You must use the tools only if necessary, and you must not use multiple tools in a single call. You should not use a tool if you can answer directly.
304
- YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
305
  If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise.
306
  If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise.
307
  If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string.
@@ -359,7 +359,7 @@ chat_llm = ChatHuggingFace(llm=llm)
359
  chat_llm = ChatOpenAI(
360
  openai_api_key=OPENAI_KEY,
361
  model_name=OPENAI_MODEL,
362
- temperature=0.1
363
  )
364
 
365
  # chat = ChatHuggingFace(llm=llm, verbose=True)
@@ -373,6 +373,8 @@ agent = initialize_agent(
373
  agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
374
  agent_kwargs={"system_message": system_prompt},
375
  verbose=True,
 
 
376
  handle_parsing_errors=True
377
  )
378
 
 
300
 
301
  {tool_descriptions}
302
 
303
+ You must use the tools only if necessary, and you must not use multiple tools in a single call. You should not use a tool if you know the exact answer and can answer by yourself. Don't hallucinate.
304
+ YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you don't have a valid answer, just return "no_answer".
305
  If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise.
306
  If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise.
307
  If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string.
 
359
  chat_llm = ChatOpenAI(
360
  openai_api_key=OPENAI_KEY,
361
  model_name=OPENAI_MODEL,
362
+ temperature=0.05
363
  )
364
 
365
  # chat = ChatHuggingFace(llm=llm, verbose=True)
 
373
  agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
374
  agent_kwargs={"system_message": system_prompt},
375
  verbose=True,
376
+ max_iterations=10, # Increase as needed
377
+ max_execution_time=90.0, # Increase as needed
378
  handle_parsing_errors=True
379
  )
380