Bringing support to o1 family back + any models that don't support stop words

This commit is contained in:
João Moura
2024-09-24 22:18:20 -03:00
parent b8aa46a767
commit e19bdcb97d
104 changed files with 56051 additions and 65319 deletions

View File

@@ -78,6 +78,7 @@ class LLM:
"api_key": self.api_key,
**self.kwargs,
}
# Remove None values to avoid passing unnecessary parameters
params = {k: v for k, v in params.items() if v is not None}
@@ -94,3 +95,11 @@ class LLM:
except Exception as e:
logging.error(f"Failed to get supported params: {str(e)}")
return False
def supports_stop_words(self) -> bool:
try:
params = get_supported_openai_params(model=self.model)
return "stop" in params
except Exception as e:
logging.error(f"Failed to get supported params: {str(e)}")
return False