Skip to content

Commit bda1756

Browse files
authored
Revert "[DataProcessor] Refactor and unify text/multimodal processor pipeline…" (#7851)
This reverts commit 5820553.
1 parent 1d82c5b commit bda1756

26 files changed

Lines changed: 39 additions & 6509 deletions

fastdeploy/entrypoints/chat_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,11 @@ def parse_chat_messages(messages: List[ChatCompletionMessageParam]):
199199
role = message["role"]
200200
content = message["content"]
201201

202+
parsed_content = []
202203
if content is None:
203-
parsed_content = content
204+
parsed_content = []
204205
elif isinstance(content, str):
205-
parsed_content = content
206+
parsed_content = [{"type": "text", "text": content}]
206207
else:
207208
parsed_content = [parse_content_part(mm_parser, part) for part in content]
208209

fastdeploy/entrypoints/llm.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def chat(
276276
raise RuntimeError(f"Failed to validate 'tools' parameter in chat method: {e}") from e
277277

278278
req_ids = self._add_request(
279-
prompts=messages,
279+
prompts=[{"messages": msg} for msg in messages],
280280
sampling_params=sampling_params,
281281
chat_template_kwargs=chat_template_kwargs,
282282
chat_template=chat_template,
@@ -326,21 +326,11 @@ def _add_request(
326326
"prompt": prompts[i],
327327
"request_id": request_id,
328328
}
329-
elif isinstance(prompts[i], list) and len(prompts[i]) == 0:
330-
raise ValueError(
331-
f"prompts[{i}] is an empty list. Expected a non-empty list of int (prompt_token_ids) "
332-
"or a non-empty list of dict (messages)."
333-
)
334329
elif isinstance(prompts[i], list) and isinstance(prompts[i][0], int):
335330
tasks = {
336331
"prompt_token_ids": prompts[i],
337332
"request_id": request_id,
338333
}
339-
elif isinstance(prompts[i], list) and isinstance(prompts[i][0], dict):
340-
tasks = {
341-
"messages": prompts[i],
342-
"request_id": request_id,
343-
}
344334
elif isinstance(prompts[i], dict):
345335
tasks = prompts[i]
346336
tasks["request_id"] = request_id

fastdeploy/input/multimodal/__init__.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

fastdeploy/input/multimodal/common.py

Lines changed: 0 additions & 147 deletions
This file was deleted.

0 commit comments

Comments
 (0)