CodeWithKyrian / transformers-php

Transformers PHP is a toolkit for PHP developers to add machine learning magic to their projects easily.
https://codewithkyrian.github.io/transformers-php/
Apache License 2.0
530 stars 28 forks source link

Add chat input detection for text generation, and refactor streamer API. #21

Closed CodeWithKyrian closed 5 months ago

CodeWithKyrian commented 5 months ago

What:

Description:

This PR refines the existing detection for chat input in Text Generation Pipeline. Now the pipeline can correctly detect if the input is a chat input, and apply chat templates to it. It also modifies the pipeline to optionally accept a parameter that controls if it returns the full text as input or not.

It also includes a refactor to the Streamer class, making it more streamlined, and responsive to the output of text generation models.