mattsegal / incredibly-fast-whisper-distil-large-v2

incrediblye fast whisper using openai/whisper-large-v3 NOT the distil model

  • Public
  • 129 runs
  • L40S
  • GitHub
  • License

Input

Video Player is loading.
Current Time 00:00:000
Duration 00:00:000
Loaded: 0%
Stream Type LIVE
Remaining Time 00:00:000
 
1x
*file

Audio file

Output

{ "text": " Okay, so we've created our Django app. We have modified our settings for production. Now we run into this weird issue where our static files don't work when debug is false. And the reason for this is that Django doesn't want to serve your static files in production. And this is something that it doesn't really tell you until you run into this problem head first. So just to help replicate the issue, to remind you of what's going on, if we set our settings to prod using the Django settings module environment variable and we run our Python Django server thing, yeah when we run our dev server using the prod settings where we've set debug to false in those settings, and we go to our app on localhost, port 8000. Our CSS doesn't load. Sucks. And we can see that in the Django logs where we've asked Django's, the run server, HTTP server, has gone, I don't know where this styles.css file is, even though it knew where it was when debug was true. Super annoying. And so the way to fix this is to use a different method to serve static files, which is kind of what Django wanted you to do. It wants you to find an alternate way to serve them so that it's not Django's problem anymore. And the way we're going to do this is using white noise. So white noise is a tool, nice Django, basically built to solve this problem of serving static files in production as simply as possible, which is why I really like it. So here are the docs here. They're in a pretty standard format and they're very easy to get through. So I encourage you to take a quick look at them. Let's start with installing white noise. So they say you can just pip install it as the name. We're not going to run pip install like that. Instead, we're going to put white noise into our requirements text file with Django. And the reason we do this is we want to keep track of all the things that we're installing so that later on when we need to reinstall the app on a different development machine, or when we want to install our Django app on a server, we want to have a record of all the packages that we need, which is what this requirements text file does. So once we've done that, let's go into the same folder as our requirements text. You need to make sure that we're in our virtual environment and we can run pip install dash r requirements text. And I recommend you do this for all the packages that you install. You make sure you keep track of them in your requirements text file. that you install. You make sure you keep track of them in your requirements text file. So you can see we've collected, downloaded, and installed white noise and all this other stuff PyTZ, ASGRIF, whatever that is, Django, already satisfied. So they didn't get installed a second time. Instead pip skipped them, which is nice. So there we go. We can do pip show white noise to see some details about it. If you're super curious, you can run pip freeze and see that it's been installed and we've got version 5.0.1. Cool. Right, let's follow the docs. What does it say? Quick start for Django apps. Sounds good. So they say add white noise to your middleware underneath the security middleware. So I see no reason to argue with them. Let's do what they say. This is assuming that you trust these people, which I do. So let's go to our settings. Let's go to our base settings and add it to our middleware. So you might be wondering what is the middleware. This is basically... Oh, no. Copied it wrong. Don't copy. Sorry. Okay. So, middleware is basically a bunch of code that gets run when a request comes in and when a request goes out. So, what happens, I think, is a request will come into your Django server, and before it gets to your view, it will run through this code, this code, this code, this code, this code, this code, this code, this code, and this code, then it'll get to your view. Then when you return a response from your view, your response object will run through this code, this code, this code, this code, this code, this code, this code, this code, and then go out to the user. Now it could be in the other order. I'm not sure exactly which direction it runs in, but that's the general idea of middleware. So we've basically put some code in the middle of our middleware that intercepts a request for static files. And instead of hitting a view, instead it does some white noise stuff and figures out how to serve the file to the user. So that is our solution there. Yeah, cool. So there's one other thing we wanna do, and that is we actually to use white noise in development as well as in when debug is false. Because by default, run server serves static files for us. And when debug is false, it sort of stops doing that. And instead, we need to rely on white noise to do it. And so we are going to make it so that when we've got debug true and false, that it's always going to use white noise and the reason we do that is for consistency so that we don't run into any surprises so they have some bugger where did they say to do that oh i've written it down somewhere else it's somewhere in their documentation killing me Killing me. Oh well. So here's one I prepared earlier. It's a bit disappointing that I can't find exactly where they wrote down how to do this. But they basically say in your installed apps if you run white noise dot run server underscore no static. That will disable the default run server behavior of serving static files. And instead it will use white noise, which is a nice thing for us, I think. Cool, with that done, let's make sure our dev server hasn't broken. So let's use our dev settings for start. For starters, let's run run server and it can't find managepy because I'm in the wrong directory. We run run server and it appears to be working. And then we can go to localhost and do a hard refresh, holding down control or shift and this refresh thing and it's working okay. And now for the moment of truth. Go to prod, run server, go to files, refresh, this is going to be so exciting. It shits the bed. What's happened? It's still not working. The fuck, right? White noise. You promised. You promised that this would work. There's one more thing we've got to do. You promised that this would work. There's one more thing we've got to do. I know there's always one more thing we've got to do, but this is a very important one. So as I said, Django doesn't want to, like, think about your static files. Django wants someone else to take care of that problem. And part of that is a process where we take the static files in our Django app and we dump them somewhere else. And that is the purpose of the static root setting. So this is something you have to set yourself. static root. Is that the right setting? I can't remember. No it's not. You've got to do is.path. So this is an operating system like file path so you've got to join base drew and i'm going to call it static files and it's totally arbitrary what you call it but right so in our django base directory we want to dump all of our static files into a folder called static files and this path can be anywhere on your file system it just i just happened to put it here because whatever um but this is where white noise will look for your static files and if if they're not there, white noise won't do anything. So we need to take our static files and dump them into this folder for white noise to work. Right. So the way we do that is a Django management command. It's Python managepy collect static. And that's what this collect static thing does, is it takes our static files and dumps them into our folder. So it's copied 131 files into static files. So we should be able to see it here. Cool. We can do an LS on it. And you can see it's got the static files for admin and it's got the static files for our counter app. So if we have a look in counter, you can see it's got our styles.css. And if we want to get really into it, we can cat this and see that it's copied our styles. Cool. So now that we've collected our static files, put them into our collect static folder. White noise with the production settings should now work. Okay, cool. We're done. Our static files are working with production settings turned on using white noise. And that is it for now.", "chunks": [ { "text": " Okay, so we've created our Django app.", "timestamp": [ 0, 4.18 ] }, { "text": " We have modified our settings for production.", "timestamp": [ 4.18, 8.58 ] }, { "text": " Now we run into this weird issue where our static files don't work when debug is false.", "timestamp": [ 8.58, 15.42 ] }, { "text": " And the reason for this is that Django doesn't want to serve your static files in production.", "timestamp": [ 15.42, 22.04 ] }, { "text": " And this is something that it doesn't really tell you until you run into this problem head", "timestamp": [ 22.04, 27 ] }, { "text": " first. So just to help replicate the issue, to remind", "timestamp": [ 27, 31.28 ] }, { "text": " you of what's going on, if we set our settings to prod using the Django settings module environment", "timestamp": [ 31.28, 36.64 ] }, { "text": " variable and we run our Python Django server thing, yeah when we run our dev server using", "timestamp": [ 36.64, 46.24 ] }, { "text": " the prod settings where we've set debug to false in those settings, and we go to our app on localhost, port 8000.", "timestamp": [ 46.24, 55 ] }, { "text": " Our CSS doesn't load.", "timestamp": [ 57.06, 58.3 ] }, { "text": " Sucks.", "timestamp": [ 58.9, 59.34 ] }, { "text": " And we can see that in the Django logs", "timestamp": [ 59.88, 62.86 ] }, { "text": " where we've asked Django's, the run server, HTTP server,", "timestamp": [ 62.86, 67.34 ] }, { "text": " has gone, I don't know where this styles.css file is,", "timestamp": [ 67.58, 71.9 ] }, { "text": " even though it knew where it was when debug was true.", "timestamp": [ 72.4, 75.02 ] }, { "text": " Super annoying.", "timestamp": [ 75.56, 76.72 ] }, { "text": " And so the way to fix this is to use a different method", "timestamp": [ 76.72, 81.64 ] }, { "text": " to serve static files,", "timestamp": [ 81.64, 83.2 ] }, { "text": " which is kind of what Django wanted you to do.", "timestamp": [ 83.2, 85.12 ] }, { "text": " It wants you to find an alternate way to serve them", "timestamp": [ 85.12, 87.84 ] }, { "text": " so that it's not Django's problem anymore.", "timestamp": [ 87.84, 90.2 ] }, { "text": " And the way we're going to do this is using white noise.", "timestamp": [ 90.2, 94.4 ] }, { "text": " So white noise is a tool, nice Django, basically built to solve this problem of serving static files in production", "timestamp": [ 94.4, 105.72 ] }, { "text": " as simply as possible, which is why I really like it.", "timestamp": [ 105.72, 108.64 ] }, { "text": " So here are the docs here.", "timestamp": [ 108.64, 111.88 ] }, { "text": " They're in a pretty standard format and they're very easy to get through.", "timestamp": [ 111.88, 115.54 ] }, { "text": " So I encourage you to take a quick look at them.", "timestamp": [ 115.54, 118.74 ] }, { "text": " Let's start with installing white noise.", "timestamp": [ 118.74, 120.32 ] }, { "text": " So they say you can just pip install it as the name. We're not going to run pip install like that.", "timestamp": [ 120.32, 126.98 ] }, { "text": " Instead, we're going to put white noise into our requirements text file with Django.", "timestamp": [ 127.34, 131.08 ] }, { "text": " And the reason we do this is we want to keep track of all the things that we're installing", "timestamp": [ 131.5, 135.42 ] }, { "text": " so that later on when we need to reinstall the app on a different development machine,", "timestamp": [ 135.42, 139.72 ] }, { "text": " or when we want to install our Django app on a server,", "timestamp": [ 140.2, 144.76 ] }, { "text": " we want to have a record of all the packages that we need, which is what this", "timestamp": [ 145.26, 149.36 ] }, { "text": " requirements text file does. So once we've done that, let's go into the same folder as our", "timestamp": [ 149.36, 156.48 ] }, { "text": " requirements text. You need to make sure that we're in our virtual environment and we can run", "timestamp": [ 156.48, 160.88 ] }, { "text": " pip install dash r requirements text. And I recommend you do this for all the packages", "timestamp": [ 161.6, 167.92 ] }, { "text": " that you install. You make sure you keep track of them in your requirements text file.", "timestamp": [ 167.92, 171.2 ] }, { "text": " that you install. You make sure you keep track of them in your requirements text file.", "timestamp": [ 171.2, 172.08 ] }, { "text": " So you can see we've collected, downloaded, and installed white noise and all this other stuff", "timestamp": [ 177.36, 179.04 ] }, { "text": " PyTZ, ASGRIF, whatever that is, Django, already satisfied. So they didn't get installed a second time. Instead pip skipped them, which is nice. So there we go. We can do pip show white noise", "timestamp": [ 185.2, 192.16 ] }, { "text": " to see some details about it.", "timestamp": [ 195.48, 196.24 ] }, { "text": " If you're super curious, you can run pip freeze and see that it's been installed", "timestamp": [ 199.32, 202.18 ] }, { "text": " and we've got version 5.0.1.", "timestamp": [ 202.18, 204.26 ] }, { "text": " Cool.", "timestamp": [ 205.18, 205.7 ] }, { "text": " Right, let's follow the docs.", "timestamp": [ 206.74, 208.78 ] }, { "text": " What does it say?", "timestamp": [ 208.9, 209.56 ] }, { "text": " Quick start for Django apps.", "timestamp": [ 210.96, 212.28 ] }, { "text": " Sounds good.", "timestamp": [ 212.38, 212.92 ] }, { "text": " So they say add white noise to your middleware", "timestamp": [ 213.3, 215.88 ] }, { "text": " underneath the security middleware.", "timestamp": [ 215.88, 218.42 ] }, { "text": " So I see no reason to argue with them.", "timestamp": [ 218.86, 221.04 ] }, { "text": " Let's do what they say.", "timestamp": [ 221.16, 221.98 ] }, { "text": " This is assuming that you trust these people, which I do.", "timestamp": [ 223.64, 226.48 ] }, { "text": " So let's go to our settings.", "timestamp": [ 228.1, 229.66 ] }, { "text": " Let's go to our base settings and add it to our middleware.", "timestamp": [ 230.18, 233.4 ] }, { "text": " So you might be wondering what is the middleware.", "timestamp": [ 233.8, 235.3 ] }, { "text": " This is basically...", "timestamp": [ 236.1, 237.62 ] }, { "text": " Oh, no.", "timestamp": [ 237.62, 238.36 ] }, { "text": " Copied it wrong.", "timestamp": [ 239.42, 240.24 ] }, { "text": " Don't copy.", "timestamp": [ 242.28, 243.64 ] }, { "text": " Sorry. Okay. So, middleware is basically a bunch of code that gets run when a request comes in and when a request goes out. So, what happens, I think, is a request will", "timestamp": [ 251.16, 259.52 ] }, { "text": " come into your Django server, and before it gets to your view, it will run through this code,", "timestamp": [ 259.52, 263.88 ] }, { "text": " this code, this code, this code, this code, this code, this code, this code, and this code, then it'll get to your view. Then when you return a response from your view,", "timestamp": [ 264, 271.68 ] }, { "text": " your response object will run through this code, this code, this code, this code, this code, this", "timestamp": [ 272.02, 276.36 ] }, { "text": " code, this code, this code, and then go out to the user. Now it could be in the other order. I'm not", "timestamp": [ 276.36, 281.2 ] }, { "text": " sure exactly which direction it runs in, but that's the general idea of middleware.", "timestamp": [ 281.2, 284.4 ] }, { "text": " So we've basically put some code in the middle of our middleware that intercepts a request for static files.", "timestamp": [ 285.34, 293 ] }, { "text": " And instead of hitting a view,", "timestamp": [ 293.4, 294.98 ] }, { "text": " instead it does some white noise stuff", "timestamp": [ 294.98, 297.76 ] }, { "text": " and figures out how to serve the file to the user.", "timestamp": [ 297.76, 300.34 ] }, { "text": " So that is our solution there.", "timestamp": [ 300.34, 302.52 ] }, { "text": " Yeah, cool.", "timestamp": [ 305.18, 306.02 ] }, { "text": " So there's one other thing we wanna do,", "timestamp": [ 306.02, 309.66 ] }, { "text": " and that is we actually to use white noise in development as well as in when debug is false.", "timestamp": [ 309.66, 318.32 ] }, { "text": " Because by default, run server serves static files for us.", "timestamp": [ 318.78, 323.04 ] }, { "text": " And when debug is false, it sort of stops doing that.", "timestamp": [ 323.82, 326.96 ] }, { "text": " And instead, we need to rely on white noise to do it.", "timestamp": [ 327.36, 329.64 ] }, { "text": " And so we are going to make it so that when we've got debug true and false, that it's always going to use white noise and the reason we do that is for", "timestamp": [ 331.06, 340.32 ] }, { "text": " consistency so that we don't run into any surprises so they have some bugger where did they say to do that", "timestamp": [ 340.32, 348.08 ] }, { "text": " oh i've written it down somewhere else it's somewhere in their documentation", "timestamp": [ 356.64, 360.08 ] }, { "text": " killing me Killing me.", "timestamp": [ 363.52, 364 ] }, { "text": " Oh well.", "timestamp": [ 372, 376 ] }, { "text": " So here's one I prepared earlier. It's a bit disappointing that I can't find exactly", "timestamp": [ 376, 380 ] }, { "text": " where they wrote down how to do this. But they basically say in your installed apps if you run", "timestamp": [ 380, 384 ] }, { "text": " white noise dot run server underscore no static.", "timestamp": [ 384, 389 ] }, { "text": " That will disable the default run server behavior", "timestamp": [ 390.94, 393.34 ] }, { "text": " of serving static files.", "timestamp": [ 393.34, 395.22 ] }, { "text": " And instead it will use white noise,", "timestamp": [ 395.22, 397.58 ] }, { "text": " which is a nice thing for us, I think.", "timestamp": [ 397.58, 400.18 ] }, { "text": " Cool, with that done,", "timestamp": [ 400.18, 401.8 ] }, { "text": " let's make sure our dev server hasn't broken.", "timestamp": [ 401.8, 405.02 ] }, { "text": " So let's use our dev settings for start.", "timestamp": [ 405.02, 407.76 ] }, { "text": " For starters, let's run run server and it can't find managepy", "timestamp": [ 407.76, 413 ] }, { "text": " because I'm in the wrong directory.", "timestamp": [ 413.64, 415.82 ] }, { "text": " We run run server and it appears to be working.", "timestamp": [ 415.82, 420.82 ] }, { "text": " And then we can go to localhost and do a hard refresh,", "timestamp": [ 420.84, 423.68 ] }, { "text": " holding down control or shift and this refresh thing", "timestamp": [ 423.68, 426.6 ] }, { "text": " and it's working okay.", "timestamp": [ 426.6, 428.76 ] }, { "text": " And now for the moment of truth.", "timestamp": [ 428.76, 431.3 ] }, { "text": " Go to prod, run server, go to files, refresh, this is going to be so exciting. It shits the bed.", "timestamp": [ 449.82, 451.58 ] }, { "text": " What's happened?", "timestamp": [ 451.58, 452.58 ] }, { "text": " It's still not working.", "timestamp": [ 452.58, 454.34 ] }, { "text": " The fuck, right?", "timestamp": [ 454.34, 455.34 ] }, { "text": " White noise.", "timestamp": [ 455.34, 456.34 ] }, { "text": " You promised.", "timestamp": [ 456.34, 457.34 ] }, { "text": " You promised that this would work.", "timestamp": [ 457.34, 458.34 ] }, { "text": " There's one more thing we've got to do. You promised that this would work.", "timestamp": [ 458.34, 460 ] }, { "text": " There's one more thing we've got to do. I know there's always one more thing we've got to do,", "timestamp": [ 461, 463 ] }, { "text": " but this is a very important one.", "timestamp": [ 463, 466 ] }, { "text": " So as I said, Django doesn't want to, like,", "timestamp": [ 466, 470 ] }, { "text": " think about your static files.", "timestamp": [ 470, 472 ] }, { "text": " Django wants someone else to take care of that problem.", "timestamp": [ 472, 475 ] }, { "text": " And part of that is a process where we take the static files", "timestamp": [ 475, 481 ] }, { "text": " in our Django app and we dump them somewhere else. And that is", "timestamp": [ 481, 485.7 ] }, { "text": " the purpose of the static root setting. So this is something you have to set", "timestamp": [ 485.7, 491.58 ] }, { "text": " yourself. static root. Is that the right setting? I can't remember. No it's not.", "timestamp": [ 491.58, 500.16 ] }, { "text": " You've got to do is.path. So this is an operating system like file path so you've got to join base drew and i'm going to call it static", "timestamp": [ 500.16, 512 ] }, { "text": " files and it's totally arbitrary what you call it but right so in our django base directory we want", "timestamp": [ 512, 517.52 ] }, { "text": " to dump all of our static files into a folder called static files and this path can be anywhere", "timestamp": [ 517.52, 522.32 ] }, { "text": " on your file system it just i just happened to put it here because whatever um but this is where", "timestamp": [ 522.32, 528.08 ] }, { "text": " white noise will look for your static files and if if they're not there, white noise won't do anything.", "timestamp": [ 528.08, 533.96 ] }, { "text": " So we need to take our static files", "timestamp": [ 533.96, 535.68 ] }, { "text": " and dump them into this folder for white noise to work.", "timestamp": [ 535.68, 538.5 ] }, { "text": " Right.", "timestamp": [ 539.88, 540.72 ] }, { "text": " So the way we do that is a Django management command.", "timestamp": [ 542.08, 544.72 ] }, { "text": " It's Python managepy collect static.", "timestamp": [ 545.96, 549.54 ] }, { "text": " And that's what this collect static thing does,", "timestamp": [ 549.54, 551.22 ] }, { "text": " is it takes our static files and dumps them into our folder.", "timestamp": [ 551.22, 556.34 ] }, { "text": " So it's copied 131 files into static files.", "timestamp": [ 556.34, 561.14 ] }, { "text": " So we should be able to see it here.", "timestamp": [ 561.14, 564.1 ] }, { "text": " Cool.", "timestamp": [ 564.1, 564.94 ] }, { "text": " We can do an LS on it.", "timestamp": [ 565.6, 569.04 ] }, { "text": " And you can see it's got the static files for admin", "timestamp": [ 569.04, 571.24 ] }, { "text": " and it's got the static files for our counter app.", "timestamp": [ 571.74, 573.7 ] }, { "text": " So if we have a look in counter, you can see it's got our styles.css.", "timestamp": [ 573.7, 578.14 ] }, { "text": " And if we want to get really into it, we can cat this and see that it's copied our styles.", "timestamp": [ 578.14, 583.14 ] }, { "text": " Cool.", "timestamp": [ 583.8, 584.08 ] }, { "text": " So now that we've collected our static files, put them into our collect static folder.", "timestamp": [ 584.98, 591.88 ] }, { "text": " White noise with the production settings should now work.", "timestamp": [ 592.7, 595.88 ] }, { "text": " Okay, cool.", "timestamp": [ 603.78, 605.88 ] }, { "text": " We're done.", "timestamp": [ 605.88, 606.88 ] }, { "text": " Our static files are working with production settings turned on using white noise.", "timestamp": [ 606.88, 610.88 ] }, { "text": " And that is it for now.", "timestamp": [ 610.88, 618.58 ] } ] }
Generated in

Run time and cost

This model runs on Nvidia L40S GPU hardware. We don't yet have enough runs of this model to provide performance information.

Readme

This model doesn't have a readme.