From 5568dfd141aa0ba491f20fc721bc7cfc116ea9c0 Mon Sep 17 00:00:00 2001 From: Timothyxxx <384084775@qq.com> Date: Mon, 20 May 2024 17:22:07 +0800 Subject: [PATCH] Handling more exceptions; Fix hyperparameter passing --- mm_agents/agent.py | 4 ++++ run.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/mm_agents/agent.py b/mm_agents/agent.py index ef98a41..716b5b8 100644 --- a/mm_agents/agent.py +++ b/mm_agents/agent.py @@ -17,6 +17,7 @@ import openai from groq import Groq import requests +from requests.exceptions import SSLError import tiktoken from PIL import Image from google.api_core.exceptions import InvalidArgument, ResourceExhausted, InternalServerError, BadRequest @@ -519,6 +520,9 @@ class PromptAgent: # but you are forbidden to add "Exception", that is, a common type of exception # because we want to catch this kind of Exception in the outside to ensure each example won't exceed the time limit ( + # General exceptions + SSLError, + # OpenAI exceptions openai.RateLimitError, openai.BadRequestError, diff --git a/run.py b/run.py index b0d5a13..f63ad2e 100644 --- a/run.py +++ b/run.py @@ -132,6 +132,8 @@ def test( agent = PromptAgent( model=args.model, max_tokens=args.max_tokens, + top_p=args.top_p, + temperature=args.temperature, action_space=args.action_space, observation_type=args.observation_type, max_trajectory_length=args.max_trajectory_length,