Indexing completed.

This commit is contained in:
timothyafolami
2024-08-13 21:30:01 +01:00
parent eb50aed3b1
commit 8150b0a132
9 changed files with 195 additions and 100 deletions
+40 -52
View File
@@ -2,22 +2,9 @@
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com\n",
"Collecting pydub\n",
" Downloading pydub-0.25.1-py2.py3-none-any.whl.metadata (1.4 kB)\n",
"Downloading pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n",
"Installing collected packages: pydub\n",
"Successfully installed pydub-0.25.1\n"
]
}
],
"outputs": [],
"source": [
"# !pip install groq\n",
"# !pip install pydub "
@@ -32,7 +19,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
@@ -47,7 +34,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
@@ -57,7 +44,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
@@ -73,7 +60,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
@@ -84,7 +71,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 6,
"metadata": {},
"outputs": [
{
@@ -101,7 +88,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
@@ -144,7 +131,7 @@
"\n",
" return chunk_folder, chunk_paths\n",
"\n",
"def transcribe_audio_chunks(audio_file_path, chunk_duration_minutes):\n",
"def transcribe_audio_chunks(audio_file_path, chunk_duration_minutes, file_type='audio'):\n",
" # Split the audio file into chunks\n",
" chunk_folder, chunk_paths = split_audio_by_duration(audio_file_path, chunk_duration_minutes)\n",
"\n",
@@ -172,7 +159,8 @@
" # Create a document with the transcript and metadata\n",
" metadata = {\n",
" \"filename\": base_filename,\n",
" \"duration\": f\"{start_min}-{end_min} minutes\"\n",
" \"duration\": f\"{start_min}-{end_min} minutes\", \n",
" \"file type\": file_type,\n",
" }\n",
" document = Document(page_content=transcript, metadata=metadata)\n",
" documents.append(document)\n",
@@ -185,7 +173,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 8,
"metadata": {},
"outputs": [
{
@@ -206,31 +194,31 @@
"# Example usage\n",
"audio_file_path = \"data/audio-2.mp3\" # Replace with your audio file path\n",
"chunk_duration_minutes = 3 # Replace with your desired chunk duration in minutes\n",
"documents = transcribe_audio_chunks(audio_file_path, chunk_duration_minutes)"
"documents = transcribe_audio_chunks(audio_file_path, chunk_duration_minutes, file_type='audio')"
]
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Document metadata: {'filename': 'audio-2', 'duration': '0-3 minutes'}\n",
"Document metadata: {'filename': 'audio-2', 'duration': '0-3 minutes', 'file type': 'audio'}\n",
"Transcript: Hey guys, ChrisFix here and today I'm going to show you how to change the oil in your car or truck. This video is specifically geared to beginners who have never done an oil change. So this is going to be an in-depth video and after watching it you'll be able to change your own oil. Many inexpensive oil change shops will use cheap oil and really cheap filters. So by doing an oil change yourself you could use good motor oil, a good filter, and know the job is getting done right. Plus you get to save some money and it's fun to work on your own car. If you've ever done oil changes before and want to share your tips, leave a comment. Now let's take a look at the tools you need to change your oil. So here's everything you're going to need to change your oil. You can see we're just using common hand tools. We have a socket set that has a ratchet and some sockets. Gloves so you don't get the oil on your skin because oil is not good for you. Paper towels to clean up. We have our oil and filter and I'll explain in a second how to find the correct oil and the correct filter for your car. We have an oil filter wrench, you might need it or you might not but it's worth to have just in case. We have an oil catch pan so you can recycle your old oil and a funnel so you can fill up your engine with new oil. I'm also including a breaker bar just in case your drain bolt is hard to get off. This will make it really easy. In addition to tools to change the oil, you're also going to need something to jack your vehicle up. In this case we have ramps or you could use jack and jack stands and then a piece of wood to block off the rear tires and I'll show you everything. There's also another method you could use where you don need any of this You could just drive your vehicle up onto the curb to get enough access to safely get underneath and drain the oil So you can use whatever method works for you I just want to note also that any tools that I using here including the jacks jack stands ramps and even the oil check the description. I'll link everything. So if you don't have something, you could easily find it and you could easily see what I used. And as always, if you have any questions throughout this process, leave a comment below and I answer every question and comment. So by the end of this video, you'll be an oil change expert. So let's go take a trip to the store and let me show you how to find out what oil your car takes. To figure out what oil your car takes, you can look in the owner's manual. So just go grab your owner's manual. We're going to flip to the back here. You can look under oil and capacities. You can see it tells you how much oil you're going to need. So we're going to need 4 14 quarts. And then you want to check the viscosity of the oil that you need. and we're going to need 4 14 quarts of 0W-20. So let's go to the store and we'll check that out right now. Alright, we're in the store and we need to find a synthetic 0W-20 oil. There's a ton of oil to choose from. Here is 0W-20. You can see, here's where the viscosities are listed. 0W-20 is right here. Here's 10W-30. So make sure you get the correct viscosity. Here's the 0W-20 we need. We want a full synthetic. We need at least 4 quarts and this container has 5, so that's plenty. If you have an older car, you might not need synthetic, but I personally like running synthetic oil even in my older cars. There are a lot of myths out there on switching to synthetic, and just to be clear, I don't think there's a lot of myths out there on switching to synthetic. I think it's a good idea to switch to synthetic oil. I think it's a good idea to switch to synthetic oil.\n",
"Document metadata: {'filename': 'audio-2', 'duration': '3-6 minutes'}\n",
"Document metadata: {'filename': 'audio-2', 'duration': '3-6 minutes', 'file type': 'audio'}\n",
"Transcript: so that you know you could switch to synthetic and you could switch back to conventional at any time. Conventional is cheaper, but on most new cars, you need to run synthetic. Plus, synthetic oil lasts longer. Speaking of how long oil lasts, change your oil at the recommended mileage that's listed in the owner's manual. Many cars have an oil life monitor that'll tell you when you need to change your oil, so just go by that. If you can't find any information on when you need to change your oil, I change the oil in my cars at around 5,000 miles. My van has over 300,000 miles, and we've had that car since new, and she's still running great. Okay, so we have our oil. Now let's go find the filter. There are tons of oil filters, but which one do you pick? Well, just look in the book here, and we're doing the oil change on a 2014 Nissan Sentra. Personally, I like using pyrolator filters, but any quality filter will do. We need an L14612. Okay, L14612, L14612, right here. Good. So there we go. We got the oil and the filter. I'm going to go check out real quick, and let's go change the oil. All right, so now that we got our correct viscosity oil, 0W20, and we have the correct oil filter, let's get underneath this car. And I'm going to show you how to jack the car up first, and then I'm going to use the because that what I prefer So an oil change has three basic parts One you got to drain the oil Two you have to change the oil filter And three you have to fill it with the correct new oil Let go step by step so you know exactly what you need to do The first step is to drain the oil. And to get to the oil drain plug, we have to go underneath the vehicle. So we're going to have to lift the vehicle up. To jack the car up, if you're not completely sure how to do it, you could check the owner's manual. It tells you exactly how to jack the car up to change a spare tire. But I'm going to show you right here what you need to do. And you want to make sure before where you jack the vehicle up, you block off the rear tire so the car doesn't roll. The other thing you want to do is if you have an automatic, make sure it's in park. If you have a manual, put it in first gear and also pull the emergency brake which will prevent the car from rolling. So get your jack and place it underneath the vehicle right where your jacking points are. In this case, the jacking points have these little indents in them. That area of the frame is meant to support the vehicle and then you can jack the car up. Once the car is jacked up you can get your jack stands and place it under the car right where there's a big piece of metal on the frame and then you're going to lower the car down onto the jack stands and then you have plenty of room to get to the oil pan. So we'll just let the car down slowly and you can see the jack stand is the only thing holding it up and once your car is safely supported on the jack stands I always like I like to put the jack right back on the frame just for extra support. So if for some reason the jack stand slips or something or malfunctions, you have backup with the jack.\n",
"Document metadata: {'filename': 'audio-2', 'duration': '6-9 minutes'}\n",
"Document metadata: {'filename': 'audio-2', 'duration': '6-9 minutes', 'file type': 'audio'}\n",
"Transcript: Never be too safe. So that's how you jack your car up to do an oil change. I want to show you the method that I prefer. It's a lot easier, a lot safer, and that's using ramps. Make sure you always use jack stands and not just the jack. You don't want to just rely on the jack to protect you from the car falling on you. Like you saw, I like to use both. Double the protection. Now using ramps is my favorite method. It's the easiest, it's the safest, and it also raises the vehicle pretty high. All you have to do is park the vehicle in a spot where you can slide two ramps right under the wheels and then you just drive the car up the ramps. It's that simple. Make sure that you pull the emergency brake again and we're blocking off the rear tires again. And I think you can get why I like the ramps so much. Before you go under the car, even when you have the car jacked up, what you want to do is you want to just shake the car with your hand. The car should not move anywhere. You're just shaking it back and forth as hard as you can and it should be stable and this thing is stable. Once you know that the vehicle is safe to go under, you can see why I like using the ramps. Look at all this room that we have now. Alright so now let's go under the car and find the oil drain plug. So you can see my feet over there. This is the front of the car right here. And then we're looking up here. And if we look here you can see there's a bunch of stuff and you might be confused, oh where's the bolt that I need to undo? Where's the oil drain bolt? Well what you want to do is you want to locate the drain pan The drain pan is this right here It usually black and has a bolt coming out You can see the bolt right back here That your oil drain pan Now there's other things that look like it, but this should be pretty easy to find because you're looking for that bolt and you're looking for the black pan. But you could also see right here is another drain pan. But this drain pan here doesn't have any bolts to let fluid out. This is the transmission drain pan. So really simple to find the oil drain pan. And then actually you can see right behind the drain pan you want to locate your oil filter. In this case, oil drain pan here, oil filter is right behind it and it's up and down nice and easy to get to which is really good. In some vehicles, the oil filter is actually on top of the engine. For example, in this Toyota Tacoma you can see here. In this case though, it's underneath, it's pretty easy to get to. This is really easy to get to also. You can see the drain plug right there. Let's go get it off. Now before we remove the drain plug, get your oil collection pan, slide it under. Now we have a sideways view, you can see our filters right here, our oil drain pan is right here and our oil drain plug is right there. We have our oil catch can right here, it's kind of aimed behind a little bit because the oil is going to come out that way. In this case we're using a 14mm socket on our ratchet and to loosen you want to go this way counterclockwise righty-tighty lefty-loosey. So this might be a problem some of you might encounter where you're using your normal size ratchet it's hard to get\n",
"Document metadata: {'filename': 'audio-2', 'duration': '9-12 minutes'}\n",
"Document metadata: {'filename': 'audio-2', 'duration': '9-12 minutes', 'file type': 'audio'}\n",
"Transcript: That drain plug out. Well don't be discouraged. There's an easy trick to use. And that trick is to use one of these long breaker bars. You can see here how much longer it is than my ratchet. And this is going to give you so much leverage that it's going to be really easy to get off. If you don't have a long breaker bar like this, you can get your ratchet and slip a pipe over the end to make it longer. Watch how easy this is going to be now. Boom, it's loosened. That's all it took. all it took. So now we can loosen this the rest of the way. Once it gets really loose, make sure your drain pan is ready to go. And you can loosen this by hand. Now you can wait for all the oil to drain out. Now I should mention, some people say you should change your oil after you run the car for like 10 minutes so the oil is warm and it flows easier. In reality, it doesn't matter. If you want to change your oil with the car sitting there, you just jack it up and the car is cold, all that oil is going to be in the oil pan. You're not going to risk burning yourself, and sometimes it just makes the job easier. Now if you're going to put your car up on the ramps, then you're starting your car anyway. Just make sure if you run your engine, you let it sit for like five to 10 minutes. Let it cool off a little bit so you don't burn yourself, and also so all the oil collects in the drain pan. On some oil drain plugs, there's a gasket to help seal the plug, and you can see here there's a copper crush gasket. These gaskets are generally one use so take off the old gasket and replace it with a new one Some people reuse these gaskets one or two times and never have a problem with leaks and I one of those people but in general I suggest you replace the gasket. Alright, the oil is completely drained. There are a few drops coming out, so let's screw in the drain plug and move on to the next step. Just screw it in by hand and it should tighten right up. I like to wipe away any extra oil before I tighten it down all the way so your drain pan stays clean and so you know if there's any oil leaking from the drain plug down the road. Now we want to tighten up our drain plug and to do that we want to go clockwise. So we're going to switch this so now we're going to tighten this clockwise and notice I'm using our ratchet and not our breaker bar. You want to use the small ratchet to tighten this. You're only tightening it so it's snug you don't want to over tighten it. You over tighten it you'll strip the drain plug and you'll cause way more problems. You have a washer on there. All you need to do is tighten it down to 20 foot pounds of torque, which is nothing. So use the small ratchet. Tighten it, and once it's snug, give it a little extra turn. And that's it. So we just finished step one, removing all the old oil. Now step two is changing the old oil filter. Okay, so we should be be able to get this off by hand. Nope, too tight. So if your oil filter is tight and it won't come off, we have four different style tools that you can use to get your oil filter off. This one's my favorite because it works for all different sizes.\n",
"Document metadata: {'filename': 'audio-2', 'duration': '12-15 minutes'}\n",
"Document metadata: {'filename': 'audio-2', 'duration': '12-15 minutes', 'file type': 'audio'}\n",
"Transcript: It's literally just a wrench and it grabs on and then you can turn it. This one, put it in here and then as you turn, you can see it gets smaller. But you can see this is a really small filter. This is for actually a big 454 cubic inch engine. So the oil filter on that is huge. Here's another adjustable one. It's rubber so it grabs on really tight. Just close it by pulling the rubber through here. and then when you turn to loosen, you turn like this, and it kind of grips because it's turning on here and grabbing it. These are good because they're adjustable, and they work on all different sizes. And the last style is this style, but you need it for each specific size that you use. But this is a really small filter, so you can see it won't work. But the idea is it's just like a giant socket for a filter. And then you can put your wrench right in here, just like that, and then boom. comes right off. But we're going to be using this because it's easy to use, quick, grabs on all different size filters. So let's get this filter off. Okay. You can see that does the trick. We can unscrew this the rest the way by hand. Make sure your oil catch can is right below where this is because this is going to leak oil. As you can see There we go Just put that right in there Alright so with our old filter out we want to grab our new filter And I like to pre-oil my filter. It prevents the car from running dry when you first start it up. So if you just put this filter in now and screw it in, there's no oil in here. So the oil has to fill this and then go to all the engine parts. But if we fill this first with our brand new oil, then we don't have to worry about the engine running dry and this is just going to give you a longer lasting engine. I should also mention that not every car you're going to be able to pre-fill these because some cars it's upside down or some cars it's in sideways. We just want to carefully fill this filter to the top just like that. Now what you want to do is you want to get oil around this gasket. You can see a little bit of oil got on the gasket just by chance but you want to make Make sure you have a clean finger. Just get a little bit of oil and just put it right around this gasket. And what that's going to do is it's going to make it easier to come off next time you do this and it's also going to prevent leaks. And that's all you need to do. Now let's go install it. So there's the drain pin. We go up and you look here and that's what the oil filter adapter looks like. And if we look there you can see the oil filter screws right onto that middle stud there. So it screws in right there. And you just try to make it flush as you turn it. So if it's flat as you turn it, it's going to be a little bit more stable.\n",
"Document metadata: {'filename': 'audio-2', 'duration': '15-18 minutes'}\n",
"Document metadata: {'filename': 'audio-2', 'duration': '15-18 minutes', 'file type': 'audio'}\n",
"Transcript: should grab and you'll know when it grabs you'll feel it. Don't force it, it should go on really easily. You can see there, it's on. So now I just tighten it by hand. Don't use any tools to tighten these, just tighten it by hand. If your hands are slippery because it's oily, you grab a towel, clean it off and then turn it more by hand with the towel. Good. So step one is done. Step two, changing the oil filter is done. Now let's get the car on the ground and do step three which is adding new oil. So we're going to add the oil to the engine while we're on the ramps just so that we make sure that we don't start the engine with no oil in it. And when you're looking for where you add your oil, it's usually at the top of the engine. Here's where you check your oil. You can see it says engine oil on here. And that's not where you fill it. Where you fill it is right up here. It has the oil sign. It's upside down but it has the oil sign on here. And this is all dirty so you don't want to just take this cap off you want to clean the area first because you don't want that junk falling into the engine so just get your paper towel get in here and clean it good now that that's clean we can take this cap off and we'll place our funnel right in here so we could fill the engine up with brand new oil so on the side of our bottle we have a scale here that tells you how many quarts or liters you have and you want to do this on a level surface but you can see we pretty much full right now and we need to add four quarts It was four and a quarter quarts with the filter but we added the oil to the filter so it really just four quarts So we want to have a quart left which is right down here. I always have a towel ready just in case. I hate spilling oil on engine parts. Just a little top tip. If you pour it sideways like this, you actually have a little more control, surprisingly. And usually the oil doesn't come out in blobs. It comes out nice and smooth instead. So if we look here we have about a half a quart we need to add. And it looks like we're at about one quart so I'm going to stop there. Close that up. So we just finished the last step which is add oil. We have one more step to do and And that is to get the car off the jack stands, or in this case the ramp, on level ground and check the oil. Since we added oil, we can start the car. And you just want to make sure that there's no oil lights on. And you can see the oil light isn't on, so that means the engine's getting oil. Now we can back the car down. And now that we have the car back down on level ground, let's go check the oil. So shut the engine off. You want to let the engine sit for about 5 minutes so all the oil drops back down since we did start the engine.\n",
"Document metadata: {'filename': 'audio-2', 'duration': '18-21 minutes'}\n",
"Document metadata: {'filename': 'audio-2', 'duration': '18-21 minutes', 'file type': 'audio'}\n",
"Transcript: After you let it sit for five minutes, get a towel, pull your dipstick out and clean it off. Put it back in. Make sure it's pushed down all the way. And then pull the dipstick back out. Okay, if we look at the dipstick, what you're looking for is the oil. You can see the oil's over here. There's low and there's high. So that dot right there means that the oil is low and you need to fill it up. That dot right there means the oil is high and it means that you have it completely full. Anywhere in between is good. I prefer trying to get it to the high. Now sometimes it's hard to see how much oil is on here, especially this brand new oil and especially this synthetic oil. So if you flip this over, you actually get a better look and you can see the oil goes right there. So we're right on the high, which is perfect. So we don't have to add oil or anything. If yours is too low, add a little bit of oil and check the level again. If you end up adding a little bit too much oil, that's not a big deal. If you add over a quart of extra oil, then you have a problem and you probably have to remove some of it because that could actually cause engine problems And that is the complete guide to changing oil in your car or truck Hopefully after this video you have no questions but if you do have questions just comment below I answer every comment and question Also if you end up doing your first oil change after watching this video, definitely let me know because I love to hear that stuff. Hopefully this video was helpful. If it was, remember to give it a thumbs up. Up on the screen are going to be other videos. You can find the links to those videos as well as any links to any tools that I used in this video in the description. The top tip for this video is, well, where do I put all my oil that I drained out from my filter and from the car? And the answer to that is you want to dispose all of your oil responsibly. You can see here in the corner of my garage I have all these old oil containers. I really need to make an oil run. But what you do is you just fill up a container. It could be an old oil container, it could be a milk container, orange juice, whatever you have. And what you do is you just fill up these containers and you go to your local auto parts store, your local garage, your local recycle center, places that sell the oil like Walmart, most of those places will take the oil and they'll take it for free so that they could recycle it so it doesn't become an environmental hazard.\n"
]
}
@@ -245,16 +233,16 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"dict_keys(['filename', 'duration'])"
"dict_keys(['filename', 'duration', 'file type'])"
]
},
"execution_count": 42,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
@@ -265,16 +253,16 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'filename': 'audio-1', 'duration': '3-6 minutes'}"
"{'filename': 'audio-2', 'duration': '3-6 minutes', 'file type': 'audio'}"
]
},
"execution_count": 33,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
@@ -285,19 +273,19 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"# creating a function to create audio document\n",
"def create_audio_document(audio_file_path, chunk_duration_minutes=3):\n",
" documents = transcribe_audio_chunks(audio_file_path, chunk_duration_minutes)\n",
"def create_audio_document(audio_file_path, chunk_duration_minutes=3, file_type='audio'):\n",
" documents = transcribe_audio_chunks(audio_file_path, chunk_duration_minutes, file_type)\n",
" return documents"
]
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 13,
"metadata": {},
"outputs": [
{
@@ -322,22 +310,22 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[Document(metadata={'filename': 'audio-1', 'duration': '0-3 minutes'}, page_content=\" Hello friend, how is it going? Welcome back to Toyota Maintenance YouTube channel. I have today in my shop this 2009 Toyota Corolla LE. She has only 90,000 miles on the odometer. I don't know this vehicle at all. It's a new customer, new car and they asked for a very detailed inspection. The inspection is successfully finished and that gives me great opportunity to talk about the most common problems with this generation of Corolla. And let's go and start with the problem which will be most expensive to repair. And I'm pointing at this car for the reason the name of it is written right here. Variable valve timing. This 1.8 liter 2Z RFE engine is equipped with the variable valve timing and if you will have a problem with it you will basically hear the rattling on the cold start. It is the known problem but I even hesitate if I should say it very common problem I personally didn see that much happening on the cars I serviced in the past And of course it always very important when you have an engine with VVT to be on top of the oil changes keeping the oil clean and possibly avoid these problems. Speaking about engine oil, we have immediately another common problem. These engines are known for engine oil consumption. Unfortunately, some of them were using or eating engine oil way faster, consuming the oil way faster than they supposed to. to. So this vehicle has a windshield sticker for 5,000 miles. All change there is still remaining 900 miles and let me show you what I discovered on my inspection. I let it sit so the oil got a chance to get all the way in the oil pan. I pulled that engine oil lipstick and of course it was confirmed it's barely touching the low mark I hope you can see it on it yeah so even this engine is consuming more than it's supposed to within a 5,000 miles\"),\n",
" Document(metadata={'filename': 'audio-1', 'duration': '3-6 minutes'}, page_content=\" It was correctly filled to the top. This is way too much. Between the marks on this engine I believe it's 1.4 quarts. So this is way too much and this engine is part of that problem. Is it catastrophic problem or something what should stop you from purchasing it? Well, that's up to debate. It will not stop me buying this vehicle. All I will have to do within 2,000 miles or 3,000 miles is check the oil. And here it's so easy to add another 1 quart of the oil. Also, 1 quart of the oil, even if you buy the full synthetic 0W-20, costs only like 7 bucks. So what's the big deal? And let's be organized and continue still or stick still with the engine oil. And we will be looking on this side passenger side of the engine. Some people will observe the oil engine oil on this side of the engine. Do you see that sensor which is coming out there? It could be leaking from that. Or we can look a little bit later when we will lift this vehicle up we can look on the back of the engine where is timing chain tensioner it a hydraulic tensioner and its gasket could be leaking surprisingly and i agree with that it on most of these i see those leaks surprisingly this one is absolutely dry i already looked from underneath this one is exception to the rule if we stay together on this side and I will bring that light for one last time right underneath the alternator hopefully you see the water pump pulley so the water pumps they don't last forever is it the common problem I will not say I will say it's common maintenance but the word common is there so these water pumps are right here driven by this belt nicely on outside it's not a timing belt moving it because this engine has timing chain so this is a relatively easy repair a little note also what do you see right here this doesn't have an automatic belt tensioner but it's manual basically through this alternator. It's right here in front of you. Maybe that light was actually not helping us. You see the tensioner? Right here. The next item is related to the ignition.\"),\n",
" Document(metadata={'filename': 'audio-1', 'duration': '6-9 minutes'}, page_content=\" 100% say that these engines to ZRFs they have it's a common that they are misfires detected you will get that check engine light and then P0 whatever codes for misfire on the multiple cylinders or on the one only and so on and so on this vehicle the owner who brought it first time here wrote it in the comment or told me in the text message he said yeah that is there is a history with misfires on this engines on this engine particle engine and there is already one or multiple coils installed as a part of that detail inspection I confirmed that I can see that number two might be Toyota but it's not matching the way it's dirty so it was replaced I believe these are Terta Danzos yes made in Japan now what will shock you somebody was taking care of that misfire they replaced the coil and to my amazement well I was not amazed about this they did obviously replace the spar plugs To my amazement they put completely wrong spark plugs in it 2009 2ZRFE 1 liter engine and I will be not discussing in this video whatsoever that 2 liter it different beast So we focus on most common engine and the most common problems in these Corollas. So somebody put in it NGK. This engine is supposed to have only Denso SC20HR11. Did I say it correctly? SC20HR11. It's already coming. I sent the report, detailed report to the owner. I said no, that doesn't belong there. It is nice and new, but it doesn't belong there. There's supposed to be only iridium acetyl-HR11. What I pulled out, newly looking, NGK, ILKAR7B11 non-iridium plug. Why is it there? Well, because somebody was in a hurry, They then maybe had no access to the SC20HR11, but most likely they wanted safe money. This is way cheaper than Iridium's power plug which goes up to 16 bucks a piece. This one maybe was 8. Eight dollars stands for somebody made 32 dollars. Like that, just cutting corners. So no way, the owner already said.\"),\n",
" Document(metadata={'filename': 'audio-1', 'duration': '9-12 minutes'}, page_content=\" We will put the correct spark plugs. I ordered them. They are on the way. Meanwhile we are making this video. And these misfires were correctly repaired by replacing the coils. It actually the service who did this work fixed the problem. They replaced the coil which was failing. So I agree with them. That's fine. just for God's sake if you can please put correct spark plugs in that engine so the owner will not have problems in the future I already inspect the remaining areas as you know me throttle body is dirty the muff it's dirty engine air filter it's on the dirty side we are going to replace it brake fluid which cannot see it's opening from here brake fluid is also dirty the battery is incorrect it's supposed to be bigger you can even see it doesn't fit in that holder i even tested it state of health it's only like 70 percent so that should be replaced too but this i'm just giving you walk around let's go back to the most common problems. Here this vehicle still have a automatic transmission dipstick If you will stick with the advice which is written on it which says no need to replace the ATF blah blah blah blah blah well don do it maintain your fluid in your transmission don't listen to those crazy stickers they were putting on these at those years that's all nonsense we know we need to change the engine oil and maintain that and we need we know that when the automatic transmission fluid is burned it's contaminated it also needs to be replaced but these automatic transmissions are not part of this video as the common problems it's exactly opposite I don't remember at the dealer and here in my mini shop I don't remember ever have one failed I'm not saying they don't but it's not a common what is common they last actually for the lifetime of the vehicle just give them nice and clean oil another common problem we will discuss right here and it actually will be two of them right in middle of your screen. Number one front wheel bearing\"),\n",
" Document(metadata={'filename': 'audio-1', 'duration': '12-15 minutes'}, page_content=\" This vehicle has only 90,000 miles but guess what? Both bearings are already showing very small play. This one I don't know why but as usually this one is smaller. It starts on this side and the other ones follow. Let me show you. Hopefully you will be able to hear it. That's a lift. There is definitely, I will say like a millimeter if I can say that, on that diameter here the movement. So it's already in the comments and we will be dealing with that problem soon. That's unfortunately pretty costly if you have to replace bows from wheel bearings. And I said there will be two items right in front of you in the middle of screen. Wheel bearing right here and the struts. Struts, I don't know why, are relatively common problem on these. Not the rear ones. The rear has also struts. I never replaced one of them ever you can see it right here nicely it's a very simple design here nothing really go bad here except we will be coming back there but for different item So the struts on both sides these ones are totally fine Now how you will see your struts are bad Well the vehicle will start kind of bouncing around but mainly even if it's on the ground You will see there will be oil even the towers below here. It will be all wrapped in the oil. When that goes it starts leaking pretty crazy and everything will be wet here. So these ones are still original OEM and they are still holding pretty good. Where we were together looking on that engine bay you didn't see any power steering reservoir also we were looking on that water pump and the belt and the belt was kind of simply going around that's because this vehicle was equipped or is equipped with electric steering apparently there were some failures on it and it was to certain degree common problem there was campaign or it was being taken care of I personally don't see it so I'm hesitating if it should be included in the common problems I don't\"),\n",
" Document(metadata={'filename': 'audio-1', 'duration': '15-18 minutes'}, page_content=\" have these problems coming to me so I will say no but I wanted make you aware that there were definitely in certain years with that electric steering there were problems with it. Last but not least unfortunately you will discover problem and it's a common problem and you will discover it in the vehicle on your dashboard. It's not this problem. This is some kind of incredible improvement by the owner. This doesn't count. So you will be driving your vehicle and suddenly you will get that check engine light on. You will have a code for EVEB and you will hope it's just a loose filler cap or the ratchet is broken on that filler cap. You will hope it's the code and in this case it will be code for a very small leak. But unfortunately these are pretty common for filling right here. I said we will be coming back here. This is that entire evap canister. It's a complicated unit and it's very expensive. So if you ever have evap codes which are saying the purge flow is incorrect or something like that pay for a correct diagnosis because these from dealer can be extremely pricey So what is my conclusion for 2009 to 2013 Corolla generation? What's conclusion? Will I buy one or will I say no? Way too problematic vehicle. I think with the correct maintenance and paying at least a little bit of attention to the engine and keeping that oil lever correctly, I think these are super great vehicles to drive from point A to point AB. Nothing exciting obviously, but they are gas savers, they are reliable and I will say in relativity of automotive world they are super cheap to maintain in my opinion the brake job everything it's easy you have a rear drum brakes in the back you can drive a lot of miles on those this one has brand new brake pads almost in front might be the first replacement at 90 000 miles The rear brake shoes I already opened that are still 2-3mm might be purely theoretically original too.\"),\n",
" Document(metadata={'filename': 'audio-1', 'duration': '18-21 minutes'}, page_content=\" this without any hesitation buy one of these to just get to the work and back and save a lot of money on the gas that's my feeling you please share underneath the video your experience with others because that's why we filming this creating community of Toyota enthusiasts who share their own own experience if you like the video give it a thumb up and be subscribed i will always have a lot of new stuff coming your way thank you for watching and have a great day my friend\")]"
"[Document(metadata={'filename': 'audio-1', 'duration': '0-3 minutes', 'file type': 'audio'}, page_content=\" Hello friend, how is it going? Welcome back to Toyota Maintenance YouTube channel. I have today in my shop this 2009 Toyota Corolla LE. She has only 90,000 miles on the odometer. I don't know this vehicle at all. It's a new customer, new car and they asked for a very detailed inspection. The inspection is successfully finished and that gives me great opportunity to talk about the most common problems with this generation of Corolla. And let's go and start with the problem which will be most expensive to repair. And I'm pointing at this car for the reason the name of it is written right here. Variable valve timing. This 1.8 liter 2Z RFE engine is equipped with the variable valve timing and if you will have a problem with it you will basically hear the rattling on the cold start. It is the known problem but I even hesitate if I should say it very common problem I personally didn see that much happening on the cars I serviced in the past And of course it always very important when you have an engine with VVT to be on top of the oil changes keeping the oil clean and possibly avoid these problems. Speaking about engine oil, we have immediately another common problem. These engines are known for engine oil consumption. Unfortunately, some of them were using or eating engine oil way faster, consuming the oil way faster than they supposed to. to. So this vehicle has a windshield sticker for 5,000 miles. All change there is still remaining 900 miles and let me show you what I discovered on my inspection. I let it sit so the oil got a chance to get all the way in the oil pan. I pulled that engine oil lipstick and of course it was confirmed it's barely touching the low mark I hope you can see it on it yeah so even this engine is consuming more than it's supposed to within a 5,000 miles\"),\n",
" Document(metadata={'filename': 'audio-1', 'duration': '3-6 minutes', 'file type': 'audio'}, page_content=\" It was correctly filled to the top. This is way too much. Between the marks on this engine I believe it's 1.4 quarts. So this is way too much and this engine is part of that problem. Is it catastrophic problem or something what should stop you from purchasing it? Well, that's up to debate. It will not stop me buying this vehicle. All I will have to do within 2,000 miles or 3,000 miles is check the oil. And here it's so easy to add another 1 quart of the oil. Also, 1 quart of the oil, even if you buy the full synthetic 0W-20, costs only like 7 bucks. So what's the big deal? And let's be organized and continue still or stick still with the engine oil. And we will be looking on this side passenger side of the engine. Some people will observe the oil engine oil on this side of the engine. Do you see that sensor which is coming out there? It could be leaking from that. Or we can look a little bit later when we will lift this vehicle up we can look on the back of the engine where is timing chain tensioner it a hydraulic tensioner and its gasket could be leaking surprisingly and i agree with that it on most of these i see those leaks surprisingly this one is absolutely dry i already looked from underneath this one is exception to the rule if we stay together on this side and I will bring that light for one last time right underneath the alternator hopefully you see the water pump pulley so the water pumps they don't last forever is it the common problem I will not say I will say it's common maintenance but the word common is there so these water pumps are right here driven by this belt nicely on outside it's not a timing belt moving it because this engine has timing chain so this is a relatively easy repair a little note also what do you see right here this doesn't have an automatic belt tensioner but it's manual basically through this alternator. It's right here in front of you. Maybe that light was actually not helping us. You see the tensioner? Right here. The next item is related to the ignition.\"),\n",
" Document(metadata={'filename': 'audio-1', 'duration': '6-9 minutes', 'file type': 'audio'}, page_content=\" 100% say that these engines to ZRFs they have it's a common that they are misfires detected you will get that check engine light and then P0 whatever codes for misfire on the multiple cylinders or on the one only and so on and so on this vehicle the owner who brought it first time here wrote it in the comment or told me in the text message he said yeah that is there is a history with misfires on this engines on this engine particle engine and there is already one or multiple coils installed as a part of that detail inspection I confirmed that I can see that number two might be Toyota but it's not matching the way it's dirty so it was replaced I believe these are Terta Danzos yes made in Japan now what will shock you somebody was taking care of that misfire they replaced the coil and to my amazement well I was not amazed about this they did obviously replace the spar plugs To my amazement they put completely wrong spark plugs in it 2009 2ZRFE 1 liter engine and I will be not discussing in this video whatsoever that 2 liter it different beast So we focus on most common engine and the most common problems in these Corollas. So somebody put in it NGK. This engine is supposed to have only Denso SC20HR11. Did I say it correctly? SC20HR11. It's already coming. I sent the report, detailed report to the owner. I said no, that doesn't belong there. It is nice and new, but it doesn't belong there. There's supposed to be only iridium acetyl-HR11. What I pulled out, newly looking, NGK, ILKAR7B11 non-iridium plug. Why is it there? Well, because somebody was in a hurry, They then maybe had no access to the SC20HR11, but most likely they wanted safe money. This is way cheaper than Iridium's power plug which goes up to 16 bucks a piece. This one maybe was 8. Eight dollars stands for somebody made 32 dollars. Like that, just cutting corners. So no way, the owner already said.\"),\n",
" Document(metadata={'filename': 'audio-1', 'duration': '9-12 minutes', 'file type': 'audio'}, page_content=\" We will put the correct spark plugs. I ordered them. They are on the way. Meanwhile we are making this video. And these misfires were correctly repaired by replacing the coils. It actually the service who did this work fixed the problem. They replaced the coil which was failing. So I agree with them. That's fine. just for God's sake if you can please put correct spark plugs in that engine so the owner will not have problems in the future I already inspect the remaining areas as you know me throttle body is dirty the muff it's dirty engine air filter it's on the dirty side we are going to replace it brake fluid which cannot see it's opening from here brake fluid is also dirty the battery is incorrect it's supposed to be bigger you can even see it doesn't fit in that holder i even tested it state of health it's only like 70 percent so that should be replaced too but this i'm just giving you walk around let's go back to the most common problems. Here this vehicle still have a automatic transmission dipstick If you will stick with the advice which is written on it which says no need to replace the ATF blah blah blah blah blah well don do it maintain your fluid in your transmission don't listen to those crazy stickers they were putting on these at those years that's all nonsense we know we need to change the engine oil and maintain that and we need we know that when the automatic transmission fluid is burned it's contaminated it also needs to be replaced but these automatic transmissions are not part of this video as the common problems it's exactly opposite I don't remember at the dealer and here in my mini shop I don't remember ever have one failed I'm not saying they don't but it's not a common what is common they last actually for the lifetime of the vehicle just give them nice and clean oil another common problem we will discuss right here and it actually will be two of them right in middle of your screen. Number one front wheel bearing\"),\n",
" Document(metadata={'filename': 'audio-1', 'duration': '12-15 minutes', 'file type': 'audio'}, page_content=\" This vehicle has only 90,000 miles but guess what? Both bearings are already showing very small play. This one I don't know why but as usually this one is smaller. It starts on this side and the other ones follow. Let me show you. Hopefully you will be able to hear it. That's a lift. There is definitely, I will say like a millimeter if I can say that, on that diameter here the movement. So it's already in the comments and we will be dealing with that problem soon. That's unfortunately pretty costly if you have to replace bows from wheel bearings. And I said there will be two items right in front of you in the middle of screen. Wheel bearing right here and the struts. Struts, I don't know why, are relatively common problem on these. Not the rear ones. The rear has also struts. I never replaced one of them ever you can see it right here nicely it's a very simple design here nothing really go bad here except we will be coming back there but for different item So the struts on both sides these ones are totally fine Now how you will see your struts are bad Well the vehicle will start kind of bouncing around but mainly even if it's on the ground You will see there will be oil even the towers below here. It will be all wrapped in the oil. When that goes it starts leaking pretty crazy and everything will be wet here. So these ones are still original OEM and they are still holding pretty good. Where we were together looking on that engine bay you didn't see any power steering reservoir also we were looking on that water pump and the belt and the belt was kind of simply going around that's because this vehicle was equipped or is equipped with electric steering apparently there were some failures on it and it was to certain degree common problem there was campaign or it was being taken care of I personally don't see it so I'm hesitating if it should be included in the common problems I don't\"),\n",
" Document(metadata={'filename': 'audio-1', 'duration': '15-18 minutes', 'file type': 'audio'}, page_content=\" have these problems coming to me so I will say no but I wanted make you aware that there were definitely in certain years with that electric steering there were problems with it. Last but not least unfortunately you will discover problem and it's a common problem and you will discover it in the vehicle on your dashboard. It's not this problem. This is some kind of incredible improvement by the owner. This doesn't count. So you will be driving your vehicle and suddenly you will get that check engine light on. You will have a code for EVEB and you will hope it's just a loose filler cap or the ratchet is broken on that filler cap. You will hope it's the code and in this case it will be code for a very small leak. But unfortunately these are pretty common for filling right here. I said we will be coming back here. This is that entire evap canister. It's a complicated unit and it's very expensive. So if you ever have evap codes which are saying the purge flow is incorrect or something like that pay for a correct diagnosis because these from dealer can be extremely pricey So what is my conclusion for 2009 to 2013 Corolla generation? What's conclusion? Will I buy one or will I say no? Way too problematic vehicle. I think with the correct maintenance and paying at least a little bit of attention to the engine and keeping that oil lever correctly, I think these are super great vehicles to drive from point A to point AB. Nothing exciting obviously, but they are gas savers, they are reliable and I will say in relativity of automotive world they are super cheap to maintain in my opinion the brake job everything it's easy you have a rear drum brakes in the back you can drive a lot of miles on those this one has brand new brake pads almost in front might be the first replacement at 90 000 miles The rear brake shoes I already opened that are still 2-3mm might be purely theoretically original too.\"),\n",
" Document(metadata={'filename': 'audio-1', 'duration': '18-21 minutes', 'file type': 'audio'}, page_content=\" this without any hesitation buy one of these to just get to the work and back and save a lot of money on the gas that's my feeling you please share underneath the video your experience with others because that's why we filming this creating community of Toyota enthusiasts who share their own own experience if you like the video give it a thumb up and be subscribed i will always have a lot of new stuff coming your way thank you for watching and have a great day my friend\")]"
]
},
"execution_count": 38,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
+1 -1
View File
@@ -1 +1 @@
{"doc_names": ["audio-1", "audio-2", "Car-Repair-Receipt-repair", "Car-Repair-Receipt-service", "Car-Repair-Receipt-tire", "Car-Repair-Receipt-tuning", "Car-Repair-Receipt-wash", "corolla-2020-toyota-owners-manual", "data\\dodge-challenger-auto-body-repair-after", "data\\dodge-challenger-auto-body-repair-before", "How to change engine oil and filter on TOYOTA Corolla", "How to change front brake pads on TOYOTA Corolla", "How to change rear windshield wipers on TOYOTA Corolla", "How to change spark plugs on TOYOTA COROLLA", "data\\hyundai-sonata-auto-body-repair-after", "data\\hyundai-sonata-auto-body-repair-before", "data\\IMG_1436", "data\\IMG_1437", "data\\IMG_1438", "data\\IMG_1440", "data\\IMG_1441", "data\\IMG_1442", "data\\IMG_1443", "data\\IMG_1444", "data\\pontiac-vibe-auto-body-repair-after", "data\\pontiac-vibe-auto-body-repair-before", "test_rec", "data\\toyota-tacoma-auto-body-repair-after", "data\\toyota-tacoma-auto-body-repair-before"], "docs_id": ["4df88a70d30747639ad4acbec1919415", "320efd7dcc8342caa948797de7209764", "d1b538acbcd9495aae86c36306eeaf33", "17a7ece1d42243a597bd2e8c9fdeaafd", "87c8f997467649329e478155c8a26d92", "115916bb36ba49b499e1908a4e711a11", "8abf7e7a36ca4ca490da6c3f4d7b2596", "50f42432f44c431f97e9b420e2b48d8a", "73f10135c4624c148dee21de6183bf4c", "32ab58213aba442bb2ba3a4c6b236ba9", "831ee7596d0645cd8c9e096ac90f10c5", "ea2cf4e23689435092337e9f7893369c", "b51984d12cb145cb9746aca78604ce2b", "7bc00aeaec514037aab955ac20e14372", "d21528b7fe784a41b564d57b8a29a02b", "9a42e1cb1883421e934ff04f0cdb568f", "8c9973a7779747d986e4476ffc2a15e9", "e4c3ec359f974cd5b9ac8dbdba24c0c6", "6a9295089d704def89d8996c43bd5bd8", "8bd1b0b9b73a4f2faa1223f17762615a", "8514bcc0db2b48889b179cdc0dcdf5ca", "60b1c7e496644bc3afd2be26b2d32989", "caa3e181e2b94eb79241882439c470e1", "2ba154fca6624423b586e897a111ee9f", "7da26f8b65664418834882533f89bb8a", "ccc1a2a2bedd428eaf0a227cb052c3c2", "93a34ea4bb1d47fe94ec3d3990f5e49c", "00b58e4a55b44a11add00384c789a3e3", "1e7d44cec5c548d8a513bc228a7cf9a3"], "num_pages": [7, 7, 1, 2, 2, 2, 1, 588, 1, 1, 6, 7, 6, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]}
{"doc_names": ["1", "2", "3", "audio-1", "audio-2", "Car-Repair-Receipt-repair", "Car-Repair-Receipt-service", "Car-Repair-Receipt-tire", "Car-Repair-Receipt-tuning", "Car-Repair-Receipt-wash", "corolla-2020-toyota-owners-manual", "data\\dodge-challenger-auto-body-repair-after", "data\\dodge-challenger-auto-body-repair-before", "How to change engine oil and filter on TOYOTA Corolla", "How to change front brake pads on TOYOTA Corolla", "How to change front wheel bearing on TOYOTA RAV4 II [TUTORIAL AUTODOC]", "How to change rear wheel bearing on TOYOTA RAV4 II [TUTORIAL AUTODOC]", "How to change rear windshield wipers on TOYOTA Corolla", "How to change spark plugs on TOYOTA COROLLA", "data\\hyundai-sonata-auto-body-repair-after", "data\\hyundai-sonata-auto-body-repair-before", "data\\IMG_1436", "data\\IMG_1437", "data\\IMG_1438", "data\\IMG_1440", "data\\IMG_1441", "data\\IMG_1442", "data\\IMG_1443", "data\\IMG_1444", "data\\pontiac-vibe-auto-body-repair-after", "data\\pontiac-vibe-auto-body-repair-before", "test_rec", "data\\toyota-tacoma-auto-body-repair-after", "data\\toyota-tacoma-auto-body-repair-before"], "docs_id": ["8f1285940d9046b8a55dd9f00d41236e", "5ded0177f2494fcab28162f2841bd0d5", "2bb18beeb51d48158479734397b1f083", "0b79c6e0caad44ac8522edc1171e1dc5", "29b8ea4fd99e44a3b8fbbf8ef8ac6880", "4cb7fb1d4eb84ec2b719658fbe92f274", "fb9ee5da26a54e838617165893275681", "f77f280337a6485dac6dc15edec7b677", "8369ffb34d914a50b45cf0ad7c74b7f1", "ee8416cff59d42078fbe287c2ad268b7", "226fd18f73bb4cdab20ad614c0d8a569", "97d55511b936467e9573ae114314022d", "3d66c21fec1e4e1bae2b53cca97742c9", "0769d12c411348c8878552b504401168", "7dc6da9cdfce4c5992e4005f10300453", "c930ad016dd5447a8daeb7c453c6bf56", "afb0b0ef3d8b42feb278aa9d208a0f11", "72f6a7c3e5f74a7f9b3da83a49c65f59", "a6a0e43d096e439c91bbac4a6e806b4b", "d7dde21b648b45d182aa4bdf047fa39f", "f3c26f26b90e4b40ba8b96afc6875558", "4a1c69f51f4f4198b81b01d65ad5a63b", "23e8b0f4d54e491fb67e0bf2119cda45", "78e38b7d8ff34b12aaadfa9e51fef335", "9cbbfdc5c9b744a8baa74e4b8a30fc6c", "aaba2d8becb643319a000a4c55b2cf4a", "f53630b793bb404f89fdcec8ef4ba9c3", "d14dea4b06124374b8bc2081837ea965", "2d133c8456b44b3f86a2769429f74dc4", "f99af89c2ea34836b2281a50b12d1366", "b7bd085714554ab1bb7c9bd281231640", "bc0089a01ea440848cd5ca54e08295a7", "fab25d545fb6407c93f828896a22af4a", "7cc4793d3d8144cebbc9d101d7643597"], "num_pages": [2, 2, 3, 7, 7, 1, 2, 2, 2, 1, 588, 1, 1, 6, 7, 4, 2, 6, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]}
Binary file not shown.
+73 -7
View File
@@ -18,6 +18,8 @@ import numpy as np
from pydub import AudioSegment
import base64
import requests
from moviepy.editor import VideoFileClip
import ffmpeg
from dotenv import load_dotenv
load_dotenv()
@@ -44,7 +46,7 @@ embeddings = load_embedding_model()
# --------------------------------------------------------TEXT PREPROCESSING--------------------------------------------
def create_documents(doc):
def create_documents(doc, file_type='text'):
text = doc[0].page_content
metadata = doc[0].metadata
text_splitter = RecursiveCharacterTextSplitter(
@@ -60,6 +62,7 @@ def create_documents(doc):
# Increment page number based on the chunk index
doc_metadata = metadata.copy()
doc_metadata['page'] = i # Assign page number based on chunk index
doc_metadata['file_type'] = file_type
document = Document(page_content=chunk.page_content, metadata=doc_metadata)
documents.append(document)
return documents
@@ -159,11 +162,11 @@ def process_image(image_path):
# create image document
def create_image_document(image_path):
def create_image_document(image_path, file_type='image'):
# getting the image name from the image path
image_name = image_path.split('/')[-1].split('.')[0]
# setting image name as metadata
metadata = {'filename': image_name}
metadata = {'filename': image_name, 'file_type': file_type}
text_extractor = TextExtractor()
text = text_extractor.read_text_from_image(image_path)
# removing special characters and line breaks
@@ -232,7 +235,7 @@ def split_audio_by_duration(audio_file_path, chunk_duration_minutes, print_outpu
return chunk_folder, chunk_paths
def transcribe_audio_chunks(audio_file_path, chunk_duration_minutes):
def transcribe_audio_chunks(audio_file_path, chunk_duration_minutes, file_type='audio'):
# Split the audio file into chunks
chunk_folder, chunk_paths = split_audio_by_duration(audio_file_path, chunk_duration_minutes)
@@ -260,7 +263,8 @@ def transcribe_audio_chunks(audio_file_path, chunk_duration_minutes):
# Create a document with the transcript and metadata
metadata = {
"filename": base_filename,
"duration": f"{start_min}-{end_min} minutes"
"duration": f"{start_min}-{end_min} minutes",
"file_type": file_type,
}
document = Document(page_content=transcript, metadata=metadata)
documents.append(document)
@@ -271,11 +275,63 @@ def transcribe_audio_chunks(audio_file_path, chunk_duration_minutes):
return documents
# creating a function to create audio document
def create_audio_document(audio_file_path, chunk_duration_minutes=3):
documents = transcribe_audio_chunks(audio_file_path, chunk_duration_minutes)
def create_audio_document(audio_file_path, chunk_duration_minutes=3, file_type='audio'):
documents = transcribe_audio_chunks(audio_file_path, chunk_duration_minutes, file_type)
return documents
# ------------------------------------------------VIDEO PROCESSING-----------------------------------------------------
def preprocess_video_data(video_path: str, time_interval: int):
# Load the video file
video = VideoFileClip(video_path)
# Get the duration of the video
duration = video.duration
# create an audio version of the video
audio_path = video_path.replace('.mp4', '.mp3')
_ = video.audio.write_audiofile(audio_path)
# creating a snapshot of the videos at the time interval
# Extract the video filename without extension
video_name = os.path.splitext(os.path.basename(video_path))[0]
# Create a directory for snapshots using the video name
snapshot_dir = os.path.join(os.path.dirname(video_path), f"{video_name}_snapshots")
os.makedirs(snapshot_dir, exist_ok=True)
# Set the interval to 3 minutes (180 seconds)
interval = 180
# Get the duration of the video using ffmpeg
probe = ffmpeg.probe(video_path)
duration = float(probe['format']['duration'])
# Loop through the video and take snapshots at 0s, 3min, 6min, etc.
for i in range(0, int(duration), interval):
# Calculate the time for the current frame
frame_time = i
# Save the snapshot as an image file in the created folder
frame_img = os.path.join(snapshot_dir, f"frame_at_{frame_time//60}min.png")
# Extract the frame using ffmpeg
(
ffmpeg
.input(video_path, ss=frame_time)
.output(frame_img, vframes=1)
.run()
)
print(f"Snapshots saved in {snapshot_dir}.")
# now creating document from the audio file
documents = create_audio_document(audio_path, file_type='video')
return documents
#-----------------------------------------------------OTHERS--------------------------------------------------------------
@@ -340,6 +396,16 @@ def load_documents_from_directory(directory_path: str):
# adding the document name to the doc_names list
doc_names.append(doc[0].metadata['filename'])
print(f"Document {doc[0].metadata['filename']} loaded")
elif extension in video_doc:
# creating a video document
doc = preprocess_video_data(path, time_interval=180)
# appending the document to the documents list
documents.append(doc)
# appending the number of pages in the document
num_pages.append(len(doc))
# adding the document name to the doc_names list
doc_names.append(doc[0].metadata['filename'])
print(f"Document {doc[0].metadata['filename']} loaded")
# so we need to create a document id for each document
docs_id = [uuid4().hex for i in range(len(documents))]
+67
View File
@@ -141,3 +141,70 @@
2024-08-09 16:54:37,491 - INFO - Searching for Welcome back to Toyota Maintenance YouTube channel
2024-08-09 16:54:38,251 - INFO - Search completed
2024-08-09 16:54:38,251 - INFO - Page content: this without any hesitation buy one of these to just get to the work and back and save a lot of money on the gas that's my feeling you please share underneath the video your experience with others because that's why we filming this creating community of Toyota enthusiasts who share their own own experience if you like the video give it a thumb up and be subscribed i will always have a lot of new stuff coming your way thank you for watching and have a great day my friend
2024-08-13 20:58:41,424 - INFO - Loading the embeddings
2024-08-13 20:58:41,424 - INFO - Load pretrained SentenceTransformer: BAAI/bge-small-en
2024-08-13 20:58:44,354 - INFO - Embeddings loaded
2024-08-13 20:58:44,355 - INFO - Loading data from ./data
2024-08-13 20:59:10,124 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 20:59:13,543 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 20:59:25,963 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 20:59:29,994 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 20:59:46,283 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 20:59:55,082 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:00:02,253 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:00:42,413 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:00:51,403 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:01:03,013 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:01:11,703 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:01:21,169 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:01:29,965 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:01:34,920 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:02:19,716 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:02:29,937 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:02:41,684 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:02:51,082 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:03:00,847 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:03:14,058 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:03:26,223 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:06:51,134 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:06:58,273 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:07:05,453 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:07:09,473 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:07:38,113 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:07:44,064 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:08:19,853 - INFO - HTTP Request: POST https://api.groq.com/openai/v1/audio/translations "HTTP/1.1 200 OK"
2024-08-13 21:08:29,843 - INFO - Data loaded
2024-08-13 21:08:29,843 - INFO - Creating vector store
2024-08-13 21:08:30,314 - WARNING - C:\Users\timmy_3aupohg\anaconda3\envs\smog_env\Lib\site-packages\transformers\models\bert\modeling_bert.py:439: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:555.)
attn_output = torch.nn.functional.scaled_dot_product_attention(
2024-08-13 21:08:40,564 - INFO - Vector store created
2024-08-13 21:08:40,564 - INFO - Saving the vector store
2024-08-13 21:08:40,573 - INFO - Vector store saved
2024-08-13 21:21:55,683 - INFO - Receiving the search query
2024-08-13 21:24:53,607 - INFO - Searching for Autodoc app
2024-08-13 21:24:53,825 - WARNING - C:\Users\timmy_3aupohg\anaconda3\envs\smog_env\Lib\site-packages\transformers\models\bert\modeling_bert.py:439: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:555.)
attn_output = torch.nn.functional.scaled_dot_product_attention(
2024-08-13 21:24:53,993 - INFO - Search completed
2024-08-13 21:24:53,993 - INFO - Page content: Hi everybody! Here's the latest installment of AutoDoc's video tutorials on replacing car parts. The channel so you never miss a video. We post new ones every week!
2024-08-13 21:26:01,296 - INFO - Receiving the search query
2024-08-13 21:26:41,888 - INFO - Searching for Remove the rear window cover
2024-08-13 21:26:42,133 - WARNING - C:\Users\timmy_3aupohg\anaconda3\envs\smog_env\Lib\site-packages\transformers\models\bert\modeling_bert.py:439: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:555.)
attn_output = torch.nn.functional.scaled_dot_product_attention(
2024-08-13 21:26:42,322 - INFO - Search completed
2024-08-13 21:27:58,689 - INFO - Receiving the search query
2024-08-13 21:28:31,655 - INFO - Searching for Welcome back to Toyota Maintenance YouTube channel
2024-08-13 21:28:31,952 - WARNING - C:\Users\timmy_3aupohg\anaconda3\envs\smog_env\Lib\site-packages\transformers\models\bert\modeling_bert.py:439: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:555.)
attn_output = torch.nn.functional.scaled_dot_product_attention(
2024-08-13 21:28:32,048 - INFO - Search completed
2024-08-13 21:28:32,048 - INFO - Page content: this without any hesitation buy one of these to just get to the work and back and save a lot of money on the gas that's my feeling you please share underneath the video your experience with others because that's why we filming this creating community of Toyota enthusiasts who share their own own experience if you like the video give it a thumb up and be subscribed i will always have a lot of new stuff coming your way thank you for watching and have a great day my friend
2024-08-13 21:29:22,946 - INFO - Receiving the search query
2024-08-13 21:29:28,223 - INFO - Searching for Welcome back to Toyota Maintenance YouTube channel
2024-08-13 21:29:28,509 - WARNING - C:\Users\timmy_3aupohg\anaconda3\envs\smog_env\Lib\site-packages\transformers\models\bert\modeling_bert.py:439: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:555.)
attn_output = torch.nn.functional.scaled_dot_product_attention(
2024-08-13 21:29:28,626 - INFO - Search completed
2024-08-13 21:29:28,626 - INFO - Page content: this without any hesitation buy one of these to just get to the work and back and save a lot of money on the gas that's my feeling you please share underneath the video your experience with others because that's why we filming this creating community of Toyota enthusiasts who share their own own experience if you like the video give it a thumb up and be subscribed i will always have a lot of new stuff coming your way thank you for watching and have a great day my friend
+3 -1
View File
@@ -16,4 +16,6 @@ pdfplumber
pytesseract
groq
python-dotenv
pydub
pydub
moviepy
ffmpeg-python
Binary file not shown.
Binary file not shown.
+11 -39
View File
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
@@ -12,7 +12,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
@@ -32,7 +32,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
@@ -87,14 +87,14 @@
" \n",
" \n",
" # now creating document from the audio file\n",
" documents = create_audio_document(audio_path)\n",
" documents = create_audio_document(audio_path, file_type='video')\n",
" return documents\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 4,
"metadata": {},
"outputs": [
{
@@ -131,19 +131,19 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[Document(metadata={'filename': 'How to change front wheel bearing on TOYOTA RAV4 II [TUTORIAL AUTODOC]', 'duration': '0-3 minutes'}, page_content=\" Hi everybody! Here's the latest installment of AutoDoc's video tutorials on replacing car parts. The channel so you never miss a video. We post new ones every week!\"),\n",
" Document(metadata={'filename': 'How to change front wheel bearing on TOYOTA RAV4 II [TUTORIAL AUTODOC]', 'duration': '3-6 minutes'}, page_content=\" How to make a You can buy spare parts from us on our website or in the Autodoc app. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. 15. Remove the rear window cover. 16. Remove the rear window cover. 17. Remove the rear window cover. 18. Remove the rear window cover. 19. Remove the rear window cover. I'll see you next time.\"),\n",
" Document(metadata={'filename': 'How to change front wheel bearing on TOYOTA RAV4 II [TUTORIAL AUTODOC]', 'duration': '6-9 minutes'}, page_content=\" How to make a Are you interested in this product? All links can be found in the description. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. Add the so I going to make a fire with a fire extinguisher I going to make a fire with a fire extinguisher I'm going to make a fire with a fire extinguisher. I'm going to make a fire with a fire extinguisher. I'm going to make a fire with a fire extinguisher. The\"),\n",
" Document(metadata={'filename': 'How to change front wheel bearing on TOYOTA RAV4 II [TUTORIAL AUTODOC]', 'duration': '9-12 minutes'}, page_content=\" I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. Thank you for watching our video tutorials. If you enjoyed watching, click thumbs up and share it with your friends. Have a nice day! Follow us on social media. Find us on Instagram and TikTok!\")]"
"[Document(metadata={'filename': 'How to change front wheel bearing on TOYOTA RAV4 II [TUTORIAL AUTODOC]', 'duration': '0-3 minutes', 'file_type': 'video'}, page_content=\" Hi everybody! Here's the latest installment of AutoDoc's video tutorials on replacing car parts. The channel so you never miss a video. We post new ones every week!\"),\n",
" Document(metadata={'filename': 'How to change front wheel bearing on TOYOTA RAV4 II [TUTORIAL AUTODOC]', 'duration': '3-6 minutes', 'file_type': 'video'}, page_content=\" How to make a You can buy spare parts from us on our website or in the Autodoc app. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. 15. Remove the rear window cover. 16. Remove the rear window cover. 17. Remove the rear window cover. 18. Remove the rear window cover. 19. Remove the rear window cover. I'll see you next time.\"),\n",
" Document(metadata={'filename': 'How to change front wheel bearing on TOYOTA RAV4 II [TUTORIAL AUTODOC]', 'duration': '6-9 minutes', 'file_type': 'video'}, page_content=\" How to make a Are you interested in this product? All links can be found in the description. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. I'm going to make a hole in the bottom of the box. Add the so I going to make a fire with a fire extinguisher I going to make a fire with a fire extinguisher I'm going to make a fire with a fire extinguisher. I'm going to make a fire with a fire extinguisher. I'm going to make a fire with a fire extinguisher. The\"),\n",
" Document(metadata={'filename': 'How to change front wheel bearing on TOYOTA RAV4 II [TUTORIAL AUTODOC]', 'duration': '9-12 minutes', 'file_type': 'video'}, page_content=\" I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. I'm going to make a new one. Thank you for watching our video tutorials. If you enjoyed watching, click thumbs up and share it with your friends. Have a nice day! Follow us on social media. Find us on Instagram and TikTok!\")]"
]
},
"execution_count": 9,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
@@ -159,34 +159,6 @@
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,