Phish commited on
Commit
097faac
1 Parent(s): db9f3a5

Update __init__.py

Browse files

simple fix used builtin map func instead of a list comprehension, incorrect usage of comprehensions.

Files changed (1) hide show
  1. phind/__init__.py +1 -1
phind/__init__.py CHANGED
@@ -26,7 +26,7 @@ class PhindResponse:
26
  return f'''<__main__.APIResponse.Completion.Choices(\n text = {self.text.encode()},\n index = {self.index},\n logprobs = {self.logprobs},\n finish_reason = {self.finish_reason})object at 0x1337>'''
27
 
28
  def __init__(self, choices: dict) -> None:
29
- self.choices = [self.Choices(choice) for choice in choices]
30
 
31
  class Usage:
32
  def __init__(self, usage_dict: dict) -> None:
 
26
  return f'''<__main__.APIResponse.Completion.Choices(\n text = {self.text.encode()},\n index = {self.index},\n logprobs = {self.logprobs},\n finish_reason = {self.finish_reason})object at 0x1337>'''
27
 
28
  def __init__(self, choices: dict) -> None:
29
+ self.choices = list(map(self.Choices, choices))
30
 
31
  class Usage:
32
  def __init__(self, usage_dict: dict) -> None: