CTranslate2 icon indicating copy to clipboard operation
CTranslate2 copied to clipboard

Provide HF AutoModel interface

Open QuietRocket opened this issue 1 year ago • 4 comments

I am interested in adding CTranslate2 support to LMQL similar to this PR which added autogptq support. In reality, it seems like the bulk of the work would have to be done in CTranslate2 to provide a high level HF Transformers "CTranslate2ForCausalLM" model interface.

I understand that the ctranslate2.Generator already provides very high level interfaces for language model text generation, but by providing the HF Transformers interface, CTranslate2 could be easily added to many more frameworks like LMQL and Microsoft's Guidance.

What do you think? Thank 😁

QuietRocket avatar Aug 01 '23 21:08 QuietRocket

Seconded! The developers at https://github.com/normal-computing/outlines would also benefit with such support.

arunpatro avatar Aug 02 '23 00:08 arunpatro

Seems like other frontends are adding glue in their codebase to support ctranslate2 inference: https://github.com/Preemo-Inc/text-generation-inference/pull/1/files#diff-aae772a4b6c3433949bf62484be62e1c4c1af6af91276820697f71345d93dea7

I don't know how the licensing works, but might be worth getting/asking to get the relevant portion as a PR here.

QuietRocket avatar Aug 08 '23 15:08 QuietRocket

Seems like other frontends are adding glue in their codebase to support ctranslate2 inference: https://github.com/Preemo-Inc/text-generation-inference/pull/1/files#diff-aae772a4b6c3433949bf62484be62e1c4c1af6af91276820697f71345d93dea7

I don't know how the licensing works, but might be worth getting/asking to get the relevant portion as a PR here.

I developed this part. You are very welcome (from my side) to pick and integrate it in CTranslate2!

michaelfeil avatar Sep 28 '23 17:09 michaelfeil