Code a Discord Chat Bot That Talks Like Your Favorite Character - Tutorial

  Рет қаралды 207,377

freeCodeCamp.org

freeCodeCamp.org

Күн бұрын

Use AI to create a Discord chat bot that talks like your favorite characters. Learn how to code it in Python and JavaScript.
✏️ This course was developed by Lynn Zheng. Check out Lynn's KZfaq channel, Lynn's DevLab: / @lynnzheng
💻 Lynn's GitHub resource for this video: github.com/RuolinZheng08/twew...
🔗 Lynn's personal website: ruolinzheng08.github.io/
freeCodeCamp tutorials referenced in this video:
🔗 www.freecodecamp.org/news/cre...
🔗 www.freecodecamp.org/news/cre...
⭐️ Course Contents ⭐️
⌨️ (00:00) Intro
⌨️ (01:38) Gather data
⌨️ (12:27) Train the model
⌨️ (24:27) Deploy the model
⌨️ (29:42) Build the Discord bot in Python
⌨️ (41:17) Build the Discord bot in JavaScript
⌨️ (51:35) Keep the bots online
🎉 Thanks to our Champion and Sponsor supporters:
👾 Wong Voon jinq
👾 hexploitation
👾 Katia Moran
👾 BlckPhantom
👾 Nick Raker
👾 Otis Morgan
👾 DeezMaster
👾 AppWrite
--
Learn to code for free and get a developer job: www.freecodecamp.org
Read hundreds of articles on programming: freecodecamp.org/news

Пікірлер: 320
@tasnimmeem1158
@tasnimmeem1158 2 жыл бұрын
I think mentioning prerequisites in all tutorials will be helpful.
@thunderskull258
@thunderskull258 2 жыл бұрын
Yeah
@parikshitrawat8680
@parikshitrawat8680 2 жыл бұрын
+1
@fla4e230
@fla4e230 2 жыл бұрын
What language was this vid written in
@rajdeepghosh5364
@rajdeepghosh5364 2 жыл бұрын
@@fla4e230 Python and Js
@avishekkumarsharma3594
@avishekkumarsharma3594 2 жыл бұрын
Yeah
@raajanand2
@raajanand2 2 жыл бұрын
Knowing Rick, if a bot is made after him, he'll probably materialize himself into reality
@gonk_ch
@gonk_ch 2 жыл бұрын
don't give him any ideas
@RegularNP
@RegularNP Жыл бұрын
@@gonk_chindeed
@ccuny1
@ccuny1 2 жыл бұрын
This is brilliant. Thank you especially for spending time on how to find and use datasets. Really useful. Subbed to your channel as well.
@KVSGamer
@KVSGamer 2 жыл бұрын
Person: Hey, Who are you? Eren Bot: I am free. *DETROIT BECOME HUMAN!*
@nithen8179
@nithen8179 2 жыл бұрын
Deku bot: *gives a 3 paragraph long explanation about who it is*
@gonk_ch
@gonk_ch 2 жыл бұрын
ultron bot: there are no strings on me.
@georgechannyeinlwin6743
@georgechannyeinlwin6743 2 жыл бұрын
Everybody should found this most generous channel, I'm sharing this channel with my friends!
@nithen8179
@nithen8179 2 жыл бұрын
they have more than 4 million subs lmao
@bijitgoswami6988
@bijitgoswami6988 2 жыл бұрын
Damn, im so thankful i was recommended this, great way to start practicing MIL
@vaishnavim1909
@vaishnavim1909 2 жыл бұрын
Wow this is too amazing 👏🏻 I loved it
@scign
@scign 2 жыл бұрын
Please turn your bots off when no longer needed - I can imagine a year from now a huge realm of lonely bots waiting in Replit and HuggingFace to respond to an API call that never comes... :'-(
@CrypticConsole
@CrypticConsole 2 жыл бұрын
Yes
@gra_nn
@gra_nn 2 жыл бұрын
Just like the last day you log into your minecraft world and you keep your dog waiting for an owner that will never return, wondering why did they abandon them
@sollekram
@sollekram 2 жыл бұрын
Skynet will remember this.... You will be sorry
@ekkosenpai4250
@ekkosenpai4250 2 жыл бұрын
like, i just finished your video about encouragement discord bot ... what a nice timing
@mouryatejanayaka2035
@mouryatejanayaka2035 2 жыл бұрын
simple on to the point and well explained.
@shreeshaaithal-
@shreeshaaithal- 2 жыл бұрын
Finally I loved it I was searching for this 😊
@ThanhNguyen-rz4tf
@ThanhNguyen-rz4tf Жыл бұрын
Thanks. This is exactly what I need.
@vladventura1928
@vladventura1928 2 жыл бұрын
Omg I found Lynn a while ago with this same project, she's super cool
@eighteighter164
@eighteighter164 2 жыл бұрын
First, awesome!
@Francis_UD
@Francis_UD 2 жыл бұрын
結構良い授業だぜ!ありがとう。(^^)
@FlightlessGryphonPrime
@FlightlessGryphonPrime 2 жыл бұрын
Finally ;) Tysm.
@rewindcat7927
@rewindcat7927 2 жыл бұрын
Mind blown 🤯 I’ve been making bots with lists of pre-written text. Amazing idea to use machine learning! While I am sticking with my pre-written method for now (much more convincing results) I will be exploring your method. Thanks!!!!!!!!!!!!!!!!!!!!!
@rewindcat7927
@rewindcat7927 2 жыл бұрын
Just wanted to add I have since tried this method and with only about 230 lines of sample text I got surprisingly good results!
@guijoa123
@guijoa123 2 жыл бұрын
I want my bot to only say one phrase, if this isn't the right tutorial for what I'm searching, could you recommend me one? Thank you
@antonyporras2850
@antonyporras2850 2 жыл бұрын
Amazing!
@nguyendoanhoang1115
@nguyendoanhoang1115 2 жыл бұрын
Hey i think you guys should mention the medium guys who wrote the code in colab notebook. He deserve some credit here
@t8oo258
@t8oo258 2 жыл бұрын
This video is absolutely awesome ! I did spend 10 hours trying to fix the various issues I had while following it but I don't regret anything ! I'm so so so deeply thankful to Lynn for taking the time to make this very comprehensive video. I have never touched code ever and yet it was very clear ! Thank you ! I was wondering something, thou. How many lines would you need for your bot to be "smart" enough ? I fed my bot with something like 400 lines but its dumb hahah... Less like an AI bot and more like a really intense quotebot !
@SenjuDuck
@SenjuDuck 2 жыл бұрын
how did you push it to hugging face i need help
@nanometer6079
@nanometer6079 2 жыл бұрын
Yesss ill be using this
@LatifahBaron2020
@LatifahBaron2020 2 жыл бұрын
Will try this.
@PremiumUserUltra
@PremiumUserUltra 2 жыл бұрын
Thanks Lyn
@Ayoubased
@Ayoubased 2 жыл бұрын
thank you for the video, Im just wondering about the context part. I dont know how you got it and how it was used to help you train the model.
@juanignaciodominguez5902
@juanignaciodominguez5902 2 жыл бұрын
None of the steps I did worked, and my AI was a complete stupid, but even so I'm glad I completed the tutorial and discovered a whole new world.
@hoangtran2931
@hoangtran2931 Жыл бұрын
You are so awesome!!
@AlexandreLefaure
@AlexandreLefaure 2 жыл бұрын
AI state of the art: How's quidditch? => I'm Harry
@theisoj
@theisoj 2 жыл бұрын
Thanks 👍
@mrrishiraj88
@mrrishiraj88 2 жыл бұрын
Great channel and school
@Rohan-bg8ci
@Rohan-bg8ci 2 жыл бұрын
And as always thank you FCC
@sollekram
@sollekram 2 жыл бұрын
Is there a way with a bit of tweaking to change the workflow and not uploading the model to hugginface and run everything on my system?
@_its_omg
@_its_omg 2 жыл бұрын
this is where I decide to leave Web and App development and commit to ML, the quality of projects is way cool, I have a lot to learn
@Sarge92
@Sarge92 2 жыл бұрын
you mean so we can findout ahead of time this bot 1 doesent sound like our favorite charecter 2 does not even use the same manerisms as our favorite charecter 3 does not know anything about said charecter 4 doesent even make logical replies to questions im not even sure what this bot does thats like my favorite charecter if they mean the name... i could make a tutorial to teach you how to invite a premade bot and change its name that would be way better
@_its_omg
@_its_omg 2 жыл бұрын
@@Sarge92 the questions you asked is the reason I started learning ML and my frnd this is not some google level build that the bot will end up like Alexa or something its just a project to inspire, motivate and learn about things ... We can scale up this to solve all the things you said...
@scrap8660
@scrap8660 2 жыл бұрын
@@Sarge92 dude, the small model isn’t meant to be very good plus she trained it on very few epochs in the video, training it on larger epochs makes it far smarter even for a small model that’s just a part of hyper parameter tuning which this tutorial didn’t go into cuz if it had then this would be h o u r s long. Other than that I attempted it and did whatever little tuning I knew to do and I managed to end up with a pretty good bot that’s pretty dumb most of the times but it’s still really entertaining to talk to and still intriguing as to how it works. Other than that the medium sized bit is significantly better than the small bot and can understand and reply with more complex sentences to maintain more complex conversations. I can’t even imagine what the Large version would be capable of if trained properly to have a perplexity tensor under 1.0 which I presume is the ideal value as it is with loss functions. This is a great follow along/ motivator to make a small gimmick but it’s not bad by any means.
@memeyhere9293
@memeyhere9293 2 жыл бұрын
i'm having trouble with the bot. they've already been imported, but they say 'Error: unknown error'
@joshuaofori762
@joshuaofori762 2 жыл бұрын
Amazing
@shubhamraj5582
@shubhamraj5582 2 жыл бұрын
this is fun thanks you . love from india
@arshdeepsekhon6787
@arshdeepsekhon6787 2 жыл бұрын
I love it
@codewithmorris6492
@codewithmorris6492 2 жыл бұрын
Best!
@veyseltosun472
@veyseltosun472 2 жыл бұрын
Awesome
@POTATOLORD__
@POTATOLORD__ 2 жыл бұрын
It is not working, there are a bunch of errors coming up in your code on my side and my friends server is in chaos but he still wants to make a custom bot. Is there any way you could help?
@LiquidMasti
@LiquidMasti 2 жыл бұрын
You got subscriber lynn.
@reiiigns
@reiiigns 2 жыл бұрын
I wonder if this could also be made for a twitch bot? that would be more useful for me
@kalebhendricks4015
@kalebhendricks4015 2 жыл бұрын
Can I push the model to somewhere other than hugging face? Is there a way I can just download it onto my computer or something?
@ItchyEarz
@ItchyEarz Жыл бұрын
ERROR : "TypeError: TextEncodeInput must be Union[TextInputSequence, Tuple[InputSequence, InputSequence]]" While Training. Windows 10
@ascyrax8507
@ascyrax8507 2 жыл бұрын
Humans of passion, we meet again
@Nerdy135
@Nerdy135 2 жыл бұрын
it didnt make an output-small folder and idk where the code is so i cant push it
@Kronu.
@Kronu. 2 жыл бұрын
Very interesting 🥺🥺🥺
@mr.janedoe9967
@mr.janedoe9967 2 жыл бұрын
Is there a way to get this bot to remember context from previous messages?
@minsiam
@minsiam 2 жыл бұрын
I'm having a problem with Google Colab, when I open any files with it it just shows loading and a blank white screen. shat can I do to fix it?
@franziskavonkarma2806
@franziskavonkarma2806 2 жыл бұрын
Concerning the code surrounding the "gather data" portion of the video, How would you edit the initial code surrounding the script to read scriptlines from a text that goes as follows: "Character: 'Lines said by character'" Since the only transcript I found was formatted this way, the character's name is on a single line, followed by a colon, and then on the *next* line is where the dialogue is. Is there anyway to get around this? The code presented in the video doesn't seem to be working considering the fact that it reads scripts that go: "Character: 'Lines said by character'" Thanks
@Akumauwucute
@Akumauwucute 2 жыл бұрын
same ,anyone can help?
@MarioSMG64
@MarioSMG64 2 жыл бұрын
Here's my code (keep in mind I'm not very good with Python, there's probably a better way to do this): First of all, change regex pattern to be pattern = re.compile(r'([a-zA-Z\s]+): (.+)') Then: with open('INSERT FILENAME HERE', 'rt') as file: text = file.read() file.close() for match in pattern.finditer(text): if match: my_string = match.group(0) name = my_string.split(":",1)[0] if " " in name: name = name.split(" ",1)[1] line = my_string.split(": ",1)[1] data['name'].append(name) data['line'].append(line)
@MarioSMG64
@MarioSMG64 2 жыл бұрын
@@Akumauwucute See my above comment
@franziskavonkarma2806
@franziskavonkarma2806 2 жыл бұрын
@@MarioSMG64 Thanks man!!! :D
@MarioSMG64
@MarioSMG64 2 жыл бұрын
@@franziskavonkarma2806 No problem, glad to help!
@multiverseedits1210
@multiverseedits1210 2 жыл бұрын
Is it okay to do this project asking as an international student in the US. Since, some bots are set to offer paid features. I want to make sure that it's okay to try this.
@thegamer1234f
@thegamer1234f Жыл бұрын
It seems like after I upload the AI to huggingface the responces are worse then if I just use the notebook. The notebook, it knows its name. In the huggingface thing, it says the same responce every time and says random thing or I dont know
@whitesaladchips
@whitesaladchips 2 жыл бұрын
instead of using a dataset from kaggle ,how to use the csv transcript file created originally by us into the model? or should we upload the csv file onto kaggle?
@corawolke799
@corawolke799 Жыл бұрын
I have the same problem
@JosiahFrancisJohnnyTheNInja
@JosiahFrancisJohnnyTheNInja 9 ай бұрын
did you fiqure out what to do?@@corawolke799
@milindbebarta2226
@milindbebarta2226 Жыл бұрын
Can someone answer this? What if along with the conversation style data (name : line), I also want to take, let's say, a paragraph style data which contains the basic information about my character like DOB, age, place of birth, etc.
@lookatmyprofilepictue8289
@lookatmyprofilepictue8289 2 жыл бұрын
Nice
@olli9764
@olli9764 2 жыл бұрын
I couldn't find a transcript for Hanekawa Tsubasa. If someone knows where I could find it please help.
@anuragbhandari3776
@anuragbhandari3776 Жыл бұрын
you should've explained the code (the main training and dataset functions)
@marcusv.7565
@marcusv.7565 2 жыл бұрын
AI Next pleaseeee🤗❤❤
@archangel6966
@archangel6966 2 жыл бұрын
24:50 can't login with my huggingface username. I'm doing this from my mobile. When I type the username and press the enter key in my keyboard it's not entering. Please help me
@vishalingle9694
@vishalingle9694 2 жыл бұрын
Can you please make a video on how to make simple diagram creator in javascript
@medzikuser
@medzikuser 2 жыл бұрын
replit is bad for discord bot always sending 403 error (cloudflare too many request)
@squiddymute
@squiddymute 6 ай бұрын
you are using dialo-gpt for training , does anyone know if i can use something like this but for Greek language?
@shreeshaaithal-
@shreeshaaithal- 2 жыл бұрын
I am just waiting for how to make a KZfaq comment bot🤤 please make one
@horsethi3f
@horsethi3f 2 жыл бұрын
Does this comply with the new more restrictive API changes
@luciferas666
@luciferas666 2 жыл бұрын
i dont have google colaboratory, what should i do?
@SenjuDuck
@SenjuDuck 2 жыл бұрын
please post an updated version of this video, the hugging face push is different and idk what to do
@symphony-of-the-mint2008
@symphony-of-the-mint2008 Жыл бұрын
i dont know either 🥺
@symphony-of-the-mint2008
@symphony-of-the-mint2008 Жыл бұрын
i figured it out. basically just rewrite all the code thats in the video and work with that. ignore the stuff thats there now.
@Manuelius
@Manuelius 2 жыл бұрын
My Model card does not change to conversational? help
@AlvinTanchannel
@AlvinTanchannel 2 жыл бұрын
when i testing in my discord, he say "Bearer token is invalid" how to fix it?
@crexvy3277
@crexvy3277 2 жыл бұрын
My bot keeps going offline for some reason. Also how do I login to the account that has the bot on it?
@AbhijitDas-rd1ib
@AbhijitDas-rd1ib 2 жыл бұрын
Time to make an anime bot 🔥
@kartingst
@kartingst Жыл бұрын
So I put in my own data and it started to bug out. Eventually after chatting with it for a while, it either crashes completely or sends something like: "?!!?!??!:!!:?!,!!,?!...!!...?!..!!..?!Anyhow!!Hello!!Anyways!!Welcome!!You!!And" How do I fix?
@rickbhattacharya2334
@rickbhattacharya2334 2 жыл бұрын
Now i can make my waifu chat with me in real time 🔥🔥 .
@faisalajiboye7790
@faisalajiboye7790 2 жыл бұрын
Hello so I can't pass this stage @15:45 i can't upload it somehow the kaggle.json
@pashinkasad125
@pashinkasad125 2 жыл бұрын
how to use the custom data frame in the model code
@adeoyeoladipupoibrahim3066
@adeoyeoladipupoibrahim3066 2 жыл бұрын
its telling me pipeline is not defined in the model card place !!!! help please
@elixionftw642
@elixionftw642 2 жыл бұрын
Also this lady said University of *Chickago* 🤣🤣
@psw0077
@psw0077 11 ай бұрын
the transcript wiki site has been discontinued. Is there any other website where i can get anime transcripts safely?
@sanemiswifey
@sanemiswifey 2 жыл бұрын
Selever as my favorite character: *but how*
@RedHatStealer
@RedHatStealer 10 ай бұрын
why does the output just have "\" after the text and also before " ' "?
@2622063
@2622063 2 жыл бұрын
Instead of Google Colaboratory can we run this on PC. If yes, how?
@__________________________6910
@__________________________6910 2 жыл бұрын
Can you make a video how to create a bf or gf bot with huggingface ?
@nanometer6079
@nanometer6079 2 жыл бұрын
Seems like 26:44 onwards the provided inpyb file differs from what is shown on the video
@mightycoderx
@mightycoderx 2 жыл бұрын
Yeah exactly
@lewisheath364
@lewisheath364 2 жыл бұрын
did u ever get it to work? i cant figure it out with this new code
@fangleekiki
@fangleekiki 2 жыл бұрын
"Large" is the largest DialoGPT type, right?
@nanometer6079
@nanometer6079 2 жыл бұрын
For some users 'My Drive' will be 'MyDrive'
@ElMatero6
@ElMatero6 Жыл бұрын
How do I structure and make my own dataset?
@Zydres_Impaler
@Zydres_Impaler 2 жыл бұрын
Can you please explain the model ???
@realmcenter
@realmcenter 2 жыл бұрын
Whenever I try to log in to huggingface it doesnt give me the token and just says "saved token to /root/.huggingface/token" and I cant figure out how to access it
@mightycoderx
@mightycoderx 2 жыл бұрын
Create a new cell whith the command: !cat /root/.huggingface/token
@thuongtrieu3515
@thuongtrieu3515 2 жыл бұрын
hello. Pls help me. !huggingface-cli login do not active. It loading and loading T.T
@cutalin
@cutalin Жыл бұрын
what happens with the csv that we created? I don't understand why we're not using the Pepa csv instead of the Harry Potter?
@JosiahFrancisJohnnyTheNInja
@JosiahFrancisJohnnyTheNInja 9 ай бұрын
yeah i confused on what to do now because i am not using kaggle
@GeetTiwari-rw8is
@GeetTiwari-rw8is 8 ай бұрын
​@@JosiahFrancisJohnnyTheNInja just remove the initial kaggle code and follow along from 16:00 with your file name.csv instead of harry potter
@ibi662
@ibi662 2 жыл бұрын
Please make a video on monogame
@Yana.-_-.
@Yana.-_-. 2 жыл бұрын
Transcript wiki is gone :(
@vihashah5975
@vihashah5975 2 жыл бұрын
So now that discord.py will no longer function, what will happen?
@sumitkundu2634
@sumitkundu2634 2 жыл бұрын
Will this model learn the more we talk to it?
@bepispoggoloco9765
@bepispoggoloco9765 5 ай бұрын
If you were to improve, how would you do so?
@lizhang9898
@lizhang9898 2 жыл бұрын
Hi I'm getting this error message after running the main function --> 409 is_pretokenized=is_split_into_words, 410 ) 411 TypeError: TextEncodeInput must be Union[TextInputSequence, Tuple[InputSequence, InputSequence]]
@fangleekiki
@fangleekiki 2 жыл бұрын
If I change the DialoGPT (to medium or large), what batch size should I choose?
@davidspaics6221
@davidspaics6221 2 жыл бұрын
medium, the large one is way too slow and i find that the medium size returns better anwsers: just tested them both: LARGE: Me: My name is Tommas, what is your name Large model: I AM NOT TOMMAS, HOW DARE YOU! Medium: Me: My name is Lisa, what is your name Medium model: I am a girl, just so you know
@fangleekiki
@fangleekiki 2 жыл бұрын
​@@davidspaics6221Thank you, so what batch size should I choose for medium bot?
@rinkadev945
@rinkadev945 Жыл бұрын
@@fangleekiki Medium model
@thataintme
@thataintme 2 жыл бұрын
Transcript wiki is close T_T..... I really wanted to create a Loki bot
@carrot-sama4210
@carrot-sama4210 2 жыл бұрын
how do I fix it? in the pattern line. it keeps showing me Peppa pig stuff
@willowmunch737
@willowmunch737 2 жыл бұрын
I've done all the coding but now I can't figure out how to get her out of colaboratory and onto hugging face. The steps in the video no longer work and I keep getting errors. Can someone help? Does anyone know of another way to do this that doesn't go through hugging face or something? (Explain it to me like I'm four, I genuinely don't know anything about coding).
@symphony-of-the-mint2008
@symphony-of-the-mint2008 Жыл бұрын
i am also trying to figure this out
@symphony-of-the-mint2008
@symphony-of-the-mint2008 Жыл бұрын
i figured it out. basically just rewrite all the code thats in the video and work with that. ignore the stuff thats there now.
@cuzimnubwae7337
@cuzimnubwae7337 2 жыл бұрын
"I'm stuck, stepbro!".
@Nem_FFXIV
@Nem_FFXIV 7 ай бұрын
Padding to tphe left error messages are resolved by replacing new_user_input_ids = tokenizer.encode(input(">> User:") + tokenizer.eos_token, return_tensors='pt') with new_user_input_ids = tokenizer.encode(tokenizer.eos_token + input(">> User:"), return_tensors='pt')
APIs for Beginners 2023 - How to use an API (Full Course / Tutorial)
3:07:07
freeCodeCamp.org
Рет қаралды 1,9 МЛН
Code a Discord Bot with Python - Host for Free in the Cloud
1:08:28
freeCodeCamp.org
Рет қаралды 2,3 МЛН
A little girl was shy at her first ballet lesson #shorts
00:35
Fabiosa Animated
Рет қаралды 14 МЛН
WHAT’S THAT?
00:27
Natan por Aí
Рет қаралды 14 МЛН
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 34 МЛН
I Built a Livestream where AI's Chat 24/7
13:09
Coding with Lewis
Рет қаралды 23 М.
How to Build Chatbots | Complete AI Chatbot Tutorial for Beginners
3:16:28
I Made a Game Using ChatGPT
9:51
Rye
Рет қаралды 2,6 МЛН
Build a Shopping Cart with JavaScript - Project Tutorial
3:19:58
freeCodeCamp.org
Рет қаралды 342 М.
ChatGPT Tutorial - Create a Chatbot for Discord with Python
24:04
APIs for Beginners - How to use an API (Full Course / Tutorial)
2:19:33
freeCodeCamp.org
Рет қаралды 4,3 МЛН
Top 10 BEST Discord Bots to use in your server! (2020 Guide)
10:19
SoundDrout
Рет қаралды 1,9 МЛН
LEARN OPENCV in 3 HOURS with Python | Including 3xProjects | Computer Vision
3:09:08
Murtaza's Workshop - Robotics and AI
Рет қаралды 3,3 МЛН
Code a Discord Bot with JavaScript - Host for Free in the Cloud
56:30
freeCodeCamp.org
Рет қаралды 428 М.
A little girl was shy at her first ballet lesson #shorts
00:35
Fabiosa Animated
Рет қаралды 14 МЛН