prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Documentation on running basic python server and FastAPI server
  
  
  </issue>
  <code>
  [start of vllm/outputs.py]
  1 from typing import Dict, List, Optional
  2 
  3 from vllm.sequence import SequenceGroup, SequenceStatus
  4 
  5 
  6 class CompletionOutput:
  7 
  8     def __init__(
  9         self,
  10         index: int,
  11         text: str,
  12         token_ids: List[int],
  13         cumulative_logprob: float,
  14         logprobs: List[Dict[int, float]],
  15         finish_reason: Optional[str] = None,
  16     ) -> None:
  17         self.index = index
  18         self.text = text
  19         self.token_ids = token_ids
  20         self.cumulative_logprob = cumulative_logprob
  21         self.logprobs = logprobs
  22         self.finish_reason = finish_reason
  23 
  24     def finished(self) -> bool:
  25         return self.finish_reason is not None
  26 
  27     def __repr__(self) -> str:
  28         return (f"CompletionOutput(index={self.index}, "
  29                 f"text={self.text!r}, "
  30                 f"token_ids={self.token_ids}, "
  31                 f"cumulative_logprob={self.cumulative_logprob}, "
  32                 f"logprobs={self.logprobs},"
  33                 f"finish_reason={self.finish_reason})")
  34 
  35 
  36 class RequestOutput:
  37 
  38     def __init__(
  39         self,
  40         request_id: str,
  41         prompt: str,
  42         prompt_token_ids: List[int],
  43         outputs: List[CompletionOutput],
  44     ) -> None:
  45         self.request_id = request_id
  46         self.prompt = prompt
  47         self.prompt_token_ids = prompt_token_ids
  48         self.outputs = outputs
  49 
  50     @classmethod
  51     def from_seq_group(cls, seq_group: SequenceGroup) -> "RequestOutput":
  52         # Get the top-n sequences.
  53         n = seq_group.sampling_params.n
  54         seqs = seq_group.get_seqs()
  55         assert n <= len(seqs)
  56         sorted_seqs = sorted(
  57             seqs, key=lambda seq: seq.get_cumulative_logprob(), reverse=True)
  58         top_n_seqs = sorted_seqs[:n]
  59 
  60         # Create the outputs.
  61         outputs: List[CompletionOutput] = []
  62         for seq in top_n_seqs:
  63             logprobs = seq.output_logprobs
  64             if seq_group.sampling_params.logprobs is None:
  65                 # NOTE: We need to take care of this case because the sequence
  66                 # always has the logprobs of the sampled tokens even if the
  67                 # logprobs are not requested.
  68                 logprobs = {}
  69             finshed_reason = SequenceStatus.get_finished_reason(seq.status)
  70             output = CompletionOutput(seqs.index(seq), seq.output_text,
  71                                       seq.get_output_token_ids(),
  72                                       seq.get_cumulative_logprob(), logprobs,
  73                                       finshed_reason)
  74             outputs.append(output)
  75 
  76         # Every sequence in the sequence group should have the same prompt.
  77         prompt = top_n_seqs[0].prompt
  78         prompt_token_ids = top_n_seqs[0].data.prompt_token_ids
  79         return cls(seq_group.request_id, prompt, prompt_token_ids, outputs)
  80 
  81     def __repr__(self) -> str:
  82         return (f"RequestOutput(request_id={self.request_id}, "
  83                 f"prompt={self.prompt!r}, "
  84                 f"prompt_token_ids={self.prompt_token_ids}, "
  85                 f"outputs={self.outputs})")
  86 
  87     def finished(self) -> bool:
  88         return all(output.finished() for output in self.outputs)
  89
  [end of vllm/outputs.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/vllm/outputs.py b/vllm/outputs.py
  --- a/vllm/outputs.py
  +++ b/vllm/outputs.py
  @@ -4,6 +4,18 @@
   
   
   class CompletionOutput:
  +    """The output data of one completion output of a request.
  +
  +    Args:
  +        index: The index of the output in the request.
  +        text: The generated output text.
  +        token_ids: The token IDs of the generated output text.
  +        cumulative_logprob: The cumulative log probability of the generated
  +            output text.
  +        logprobs: The log probabilities of the top probability words at each
  +            position if the logprobs are requested.
  +        finish_reason: The reason why the sequence is finished.
  +    """
   
       def __init__(
           self,
  @@ -11,7 +23,7 @@
           text: str,
           token_ids: List[int],
           cumulative_logprob: float,
  -        logprobs: List[Dict[int, float]],
  +        logprobs: Optional[List[Dict[int, float]]],
           finish_reason: Optional[str] = None,
       ) -> None:
           self.index = index
  @@ -34,7 +46,14 @@
   
   
   class RequestOutput:
  +    """The output data of a request to the LLM.
   
  +    Args:
  +        request_id: The unique ID of the request.
  +        prompt: The prompt string of the request.
  +        prompt_token_ids: The token IDs of the prompt.
  +        outputs: The output sequences of the request.
  +    """
       def __init__(
           self,
           request_id: str,
  
verification_info: {"golden_diff": "diff --git a/vllm/outputs.py b/vllm/outputs.py\n--- a/vllm/outputs.py\n+++ b/vllm/outputs.py\n@@ -4,6 +4,18 @@\n \n \n class CompletionOutput:\n+    \"\"\"The output data of one completion output of a request.\n+\n+    Args:\n+        index: The index of the output in the request.\n+        text: The generated output text.\n+        token_ids: The token IDs of the generated output text.\n+        cumulative_logprob: The cumulative log probability of the generated\n+            output text.\n+        logprobs: The log probabilities of the top probability words at each\n+            position if the logprobs are requested.\n+        finish_reason: The reason why the sequence is finished.\n+    \"\"\"\n \n     def __init__(\n         self,\n@@ -11,7 +23,7 @@\n         text: str,\n         token_ids: List[int],\n         cumulative_logprob: float,\n-        logprobs: List[Dict[int, float]],\n+        logprobs: Optional[List[Dict[int, float]]],\n         finish_reason: Optional[str] = None,\n     ) -> None:\n         self.index = index\n@@ -34,7 +46,14 @@\n \n \n class RequestOutput:\n+    \"\"\"The output data of a request to the LLM.\n \n+    Args:\n+        request_id: The unique ID of the request.\n+        prompt: The prompt string of the request.\n+        prompt_token_ids: The token IDs of the prompt.\n+        outputs: The output sequences of the request.\n+    \"\"\"\n     def __init__(\n         self,\n         request_id: str,\n", "issue": "Documentation on running basic python server and FastAPI server\n\n", "before_files": [{"content": "from typing import Dict, List, Optional\n\nfrom vllm.sequence import SequenceGroup, SequenceStatus\n\n\nclass CompletionOutput:\n\n    def __init__(\n        self,\n        index: int,\n        text: str,\n        token_ids: List[int],\n        cumulative_logprob: float,\n        logprobs: List[Dict[int, float]],\n        finish_reason: Optional[str] = None,\n    ) -> None:\n        self.index = index\n        self.text = text\n        self.token_ids = token_ids\n        self.cumulative_logprob = cumulative_logprob\n        self.logprobs = logprobs\n        self.finish_reason = finish_reason\n\n    def finished(self) -> bool:\n        return self.finish_reason is not None\n\n    def __repr__(self) -> str:\n        return (f\"CompletionOutput(index={self.index}, \"\n                f\"text={self.text!r}, \"\n                f\"token_ids={self.token_ids}, \"\n                f\"cumulative_logprob={self.cumulative_logprob}, \"\n                f\"logprobs={self.logprobs},\"\n                f\"finish_reason={self.finish_reason})\")\n\n\nclass RequestOutput:\n\n    def __init__(\n        self,\n        request_id: str,\n        prompt: str,\n        prompt_token_ids: List[int],\n        outputs: List[CompletionOutput],\n    ) -> None:\n        self.request_id = request_id\n        self.prompt = prompt\n        self.prompt_token_ids = prompt_token_ids\n        self.outputs = outputs\n\n    @classmethod\n    def from_seq_group(cls, seq_group: SequenceGroup) -> \"RequestOutput\":\n        # Get the top-n sequences.\n        n = seq_group.sampling_params.n\n        seqs = seq_group.get_seqs()\n        assert n <= len(seqs)\n        sorted_seqs = sorted(\n            seqs, key=lambda seq: seq.get_cumulative_logprob(), reverse=True)\n        top_n_seqs = sorted_seqs[:n]\n\n        # Create the outputs.\n        outputs: List[CompletionOutput] = []\n        for seq in top_n_seqs:\n            logprobs = seq.output_logprobs\n            if seq_group.sampling_params.logprobs is None:\n                # NOTE: We need to take care of this case because the sequence\n                # always has the logprobs of the sampled tokens even if the\n                # logprobs are not requested.\n                logprobs = {}\n            finshed_reason = SequenceStatus.get_finished_reason(seq.status)\n            output = CompletionOutput(seqs.index(seq), seq.output_text,\n                                      seq.get_output_token_ids(),\n                                      seq.get_cumulative_logprob(), logprobs,\n                                      finshed_reason)\n            outputs.append(output)\n\n        # Every sequence in the sequence group should have the same prompt.\n        prompt = top_n_seqs[0].prompt\n        prompt_token_ids = top_n_seqs[0].data.prompt_token_ids\n        return cls(seq_group.request_id, prompt, prompt_token_ids, outputs)\n\n    def __repr__(self) -> str:\n        return (f\"RequestOutput(request_id={self.request_id}, \"\n                f\"prompt={self.prompt!r}, \"\n                f\"prompt_token_ids={self.prompt_token_ids}, \"\n                f\"outputs={self.outputs})\")\n\n    def finished(self) -> bool:\n        return all(output.finished() for output in self.outputs)\n", "path": "vllm/outputs.py"}]}