refine code

This commit is contained in:
geekan 2024-01-08 17:14:12 +08:00
parent b16315f6c7
commit 244fa81ffe
7 changed files with 22 additions and 12 deletions

View file

@ -78,7 +78,7 @@ class FireworksLLM(OpenAILLM):
self.cost_manager = FireworksCostManager()
def _make_client_kwargs(self) -> dict:
kwargs = dict(api_key=self.config.fireworks_api_key, base_url=self.config.fireworks_api_base)
kwargs = dict(api_key=self.config.api_key, base_url=self.config.base_url)
return kwargs
def _update_costs(self, usage: CompletionUsage):

View file

@ -17,6 +17,8 @@ class YamlModel(BaseModel):
@classmethod
def read_yaml(cls, file_path: Path) -> Dict:
if not file_path.exists():
return {}
with open(file_path, "r") as file:
return yaml.safe_load(file)