简体   繁体   中英

How to train my ChatterBot model using GPU instead of CPU

I am using chatterbot library to develop a chatbot. I want to train the chatbot using my GPU instead of my CPU

Here is my code:

from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer


bot = ChatBot(
    #Bot name
    "Elon"
)

trainer = ChatterBotCorpusTrainer(bot)

trainer.train(
    'chatterbot.corpus.english'
)

while True:

    user_input = input('You: ')
    bot_response = bot.get_response(user_input)
    print(bot_response)

Looking at chatterbot's documentation, there is nothing mentioned about that. But maybe you can look at the framework that it was built on and try to change the sourcecode to allow GPU training.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM