Skip to content

Commit 6e81994

Browse files
committed
Use granite-io async interface (#936)
Signed-off-by: Louis Mandel <[email protected]>
1 parent 4cb5819 commit 6e81994

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/pdl/pdl_granite_io.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def processor_of_block(block: GraniteioModelBlock):
2424
assert isinstance(model, str), f"The model should be a string: {model}"
2525
assert isinstance(
2626
backend, (dict, str)
27-
), f"The backend should be a string or a dictionnary: {backend}"
27+
), f"The backend should be a string or a dictionary: {backend}"
2828
match backend:
2929
case {"transformers": device}:
3030
assert isinstance(backend, dict)
@@ -83,7 +83,9 @@ async def async_generate_text(
8383
assert parameters is None or isinstance(parameters, dict)
8484
io_processor = GraniteioModel.processor_of_block(block)
8585
inputs = GraniteioModel.build_message(messages, parameters)
86-
result = io_processor.create_chat_completion(inputs) # pyright: ignore
86+
result = await io_processor.acreate_chat_completion( # pyright: ignore
87+
inputs
88+
)
8789
try: # TODO: update when new version of granite-io is released
8890
message = result.next_message.model_dump()
8991
except AttributeError:

0 commit comments

Comments
 (0)