RUVIDEO
Поделитесь видео 🙏

AI & Machine Learning Made Simple Coding 18: Use free Mistral 7B Model to Generate Python Java Cod

Point of this series of videos is to make AI & Machine Learning easy to understand via live coding.


In this video, I show you how you can use Mistral 7B Model to Generate Python/Pascal/Java Code

0:08 I'm going to show you how to use the most popular model available on Hugging Face. Once again, Hugging Face is a website.
0:20 It's like GitHub for all open source AI models. They have 351,000 freely available. You can try and download and run and run in a hosted way and tell the other things.
0:35 If I click on Models, by default, it sorts all the models by Bye! The highest trending model is Mistral 7 billion model.
0:49 If you look at the category, it's text generation, so it's like chatgpt, except it's free. And now, if I sort by most downloads, I get the same, well, what's wrong?
1:05 That's not the most downloaded. So anyway, it's the most trending anyway. So most trending is Mistral 7 billion model. So what I'm going to do today is I'm going to show you how to use it for free.
1:18 On their website. If you come here on the left side, you see that it's called a model card. It has all that information about the model itself.
1:27 But our job today, my job today is to show you how you can use this. Kind of like chat GPT.
1:33 You have to pretend though, the difference here is though, it can do its best at completing what you start, right.
1:43 It doesn't really do a question answer like chat GPT does. So you have to do a little trick to get it to do what you need to do.
1:49 For example, what I really wanted to do is I wanted to run a Pascal or Python program, right. So what I'm going to do is I'm going to give the prompt something like this.
2:00 I will copy paste the prompt. I have it in different window and copied and once I show you this, it will make more sense.
2:11 So this is my prompt. Here's a Python program that runs a while loop over variable i until i reaches 100.
2:21 At the start, i has a value of one. In each iteration, it is incremented by three. Basically, a while loop.
2:30 That starts at one, increments by three, and when it gets to 100, it stops. Right? So because i said, here is a Python program, blah, blah, blah, blah, blah, blah.
2:39 If i could do the compute, if i let it run, it will try and complete the paragraph where it will try and generate more and more words, but by, because i started it this way, it's going to give me the code, right?
2:57 So because the the, the container, container running on the background isn't all that powerful and we're just making it an API call to the model, it will take quite a few runs.
3:06 So let's say compute, and you see how it starts when stuff, because it only predicted the next few words, right?
3:14 If i do compute again, it predicts a few more words. Looks like there's a problem with the code, but let's see if it actually does.
3:28 Right again? Oh, because it didn't finish, so x equals x plus, this is the increment. So, here you are. This program prints all multiple between three.
3:36 See, it's still not done. I have to click compute again for it to generate the next several words. So, compute, and it Thanks for watching.
3:44 It gives me the output, but it's not finished. I hit compute again. It does, it gives me some more numbers.
3:53 And, compute again, compute again. Compute again, compute again, compute again. And now we are done. Alright? So, the way I prompted it, it gave me the program that I wanted.
4:13 Now, I'm going to erase it. It's all the ones it created for me. This time, I'm going to say the same thing in Pascal.
4:21 Pascal is a very old language. It was my first programming language when I started my computer science undergrad program. So, same thing, different language.
4:31 It starts, Compute, compute, same idea. It's let it finish by hitting it over and over again. And here's the output, and you get the idea.
4:42 It ran the same thing in Pascal. Now, again, I'm going to do, I'm going to delete everything that has generated for me. I am going to tell this AI model, Mistralz, with 7 billion input data, I guess.
5:01 I'm going to say the same thing in Java. Compute. It starts and stops because it's not very powerful computer that's running these things.
5:13 So compute and it's still not done. Compute. Okay. It didn't because I didn't specify what the output should be. This output doesn't matter, but you get the idea.
5:30 It ran a while loop, but start with starts I at one and it comes by three and it stops when it goes to 100.
5:37 Same programming. Different language. You get the idea. You give it the prompt so that it starts generating the code for you again.
5:44 This is the most popular or trending model that we have today in hugging face. It has 351,000 models. So it must be pretty darn good.
5:54 All right. I hope this was useful to you. If it was, please like and subscribe and I will see you in the next video.

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «AI & Machine Learning Made Simple Coding 18: Use free Mistral 7B Model to Generate Python Java Cod», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.