guoquan-net commited on
Commit
1f5dcaa
·
verified ·
1 Parent(s): d3a64cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -35,12 +35,12 @@ class GetCurrentTimeInTimezoneTool(Tool):
35
  # Load the pre-built tool for image generation from the Hugging Face Hub
36
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
37
 
38
- # Model setup for the agent (using the Qwen2.5-Coder-32B-Instruct model)
39
  final_answer = FinalAnswerTool()
40
  model = HfApiModel(
41
- max_tokens=2096,
42
- temperature=0.5,
43
- model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
44
  custom_role_conversions=None,
45
  )
46
 
@@ -53,7 +53,7 @@ def get_model_response_with_retry(model_input, max_retries=3):
53
  retries = 0
54
  while retries < max_retries:
55
  try:
56
- client = InferenceClient("Qwen/Qwen2.5-Coder-32B-Instruct")
57
  response = client.text_generation(model_input)
58
  return response
59
  except Exception as e:
 
35
  # Load the pre-built tool for image generation from the Hugging Face Hub
36
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
37
 
38
+ # Model setup for the agent (switching to GPT-2 for better reliability)
39
  final_answer = FinalAnswerTool()
40
  model = HfApiModel(
41
+ max_tokens=1024, # Adjusting token limit for GPT-2
42
+ temperature=0.7,
43
+ model_id='gpt2', # Switching to GPT-2
44
  custom_role_conversions=None,
45
  )
46
 
 
53
  retries = 0
54
  while retries < max_retries:
55
  try:
56
+ client = InferenceClient("gpt2") # Using GPT-2 model
57
  response = client.text_generation(model_input)
58
  return response
59
  except Exception as e: