FastChat
FastChat copied to clipboard
Support Programmatic Usage of FastChat with Standard Streams
I've been working on a ProgrammaticChatIO class to enable control of FastChat by other programs through standard streams (stdin/stdout/stderr). This was motivated by a desire to use it in JavaScript (specifically in Deno), but it can be done from any language capable of communicating with a subprocess. This feature is prevalent across programming languages, therefore it presents numerous intriguing use cases.
I've placed the new class into the cli.py file, along with some modifications to the chat_loop function in the inference.py file. These changes do not significantly alter the existing code or structure.
Would the maintainers of FastChat be interested in adding this contribution? If so, I'd be delighted to submit a pull request for it later in the week.
Came to request the same.
Came to request the same.
Is there anything specific you need for your use case?
@laidybug why don't you submit a PR and let us take a look?
@zhisbug, I've submitted the PR.