philschmid / deep-learning-pytorch-huggingface

MIT License
618 stars 143 forks source link

Chat Inference Code #4

Closed samarthsarin closed 1 year ago

samarthsarin commented 1 year ago

Hi,

Just wanted to check after training my custom data model how should I use it as a chatbot to generate answers for questions asked by the user? Can you please tell me what needs to be changed in inference part of the code?

Looking forward to your response

philschmid commented 1 year ago

Can you please share a bit more infomration? Which model have you trained? which data? Where are you trying to do?

Transformers has a conversational pipeline for that: https://huggingface.co/docs/transformers/v4.26.1/en/main_classes/pipelines#transformers.Conversation which you could nicely combine with gradio: https://gradio.app/docs/#chatbot

samarthsarin commented 1 year ago

Thank you for your reply. It worked for me. Closing this issue.