Feat/support rerank (#6058)
This commit is contained in:
@@ -512,3 +512,12 @@ async def async_stream_and_merge(llm, prompt, sampling_params):
|
||||
cleaned_chunk = trim_overlap(final_text, chunk_text)
|
||||
final_text += cleaned_chunk
|
||||
yield cleaned_chunk # yield the non-overlapping portion
|
||||
|
||||
|
||||
def resolve_obj_by_qualname(qualname: str) -> Any:
|
||||
"""
|
||||
Resolve an object by its fully qualified name.
|
||||
"""
|
||||
module_name, obj_name = qualname.rsplit(".", 1)
|
||||
module = importlib.import_module(module_name)
|
||||
return getattr(module, obj_name)
|
||||
|
||||
Reference in New Issue
Block a user