akhaliq HF Staff commited on
Commit
770f17c
·
1 Parent(s): 0d862e7

feat: add Generator return type hint to streaming inference endpoint

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -12,6 +12,7 @@ from gradio import Server
12
  from gradio.data_classes import FileData
13
  from fastapi.responses import HTMLResponse
14
  import spaces
 
15
 
16
  # ---------- Globals & Model Loading ----------
17
  MODEL_ID = "openbmb/MiniCPM-V-4.6"
@@ -79,7 +80,7 @@ def predict(
79
  top_p: float = 0.8,
80
  top_k: int = 100,
81
  max_frames: int = 64
82
- ):
83
  """
84
  Streaming inference endpoint with history support.
85
  """
 
12
  from gradio.data_classes import FileData
13
  from fastapi.responses import HTMLResponse
14
  import spaces
15
+ from typing import Generator
16
 
17
  # ---------- Globals & Model Loading ----------
18
  MODEL_ID = "openbmb/MiniCPM-V-4.6"
 
80
  top_p: float = 0.8,
81
  top_k: int = 100,
82
  max_frames: int = 64
83
+ ) -> Generator[str, None, None]:
84
  """
85
  Streaming inference endpoint with history support.
86
  """