{"cells":[{"cell_type":"markdown","metadata":{"id":"rntJPk4H2OoF"},"source":["# Download YouTube Video's Audio"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"JCDAbzvU1DqZ","executionInfo":{"status":"ok","timestamp":1684335388686,"user_tz":-330,"elapsed":2746,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}},"colab":{"base_uri":"https://localhost:8080/"},"outputId":"fac42ea3-3bd3-4cf9-aaaf-9f83d2190fac"},"outputs":[{"output_type":"stream","name":"stdout","text":["\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/57.6 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m57.6/57.6 kB\u001b[0m \u001b[31m4.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25h"]}],"source":["! pip install pytube -q "]},{"cell_type":"code","execution_count":null,"metadata":{"id":"IRT0zkiT1Q1L"},"outputs":[],"source":["from pytube import YouTube"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"z4s2ZtSmHj3-"},"outputs":[],"source":["VIDEO_URL = 'https://www.youtube.com/watch?v=u31GMvCILPA&list=PLnD0GeV9CG_Pc1gSnMa1yrTD9CdiX1tBY&index=9' "]},{"cell_type":"code","execution_count":null,"metadata":{"id":"nhBsFZ4V1wZG"},"outputs":[],"source":["yt = YouTube(VIDEO_URL)"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":35},"id":"zk1w07V21XDZ","outputId":"88298767-2495-422d-b846-4d90d51c511c","executionInfo":{"status":"ok","timestamp":1684339547074,"user_tz":-330,"elapsed":2854,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":["'/content/ytaudio.mp4'"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"string"}},"metadata":{},"execution_count":56}],"source":["audio_stream = yt.streams.filter(only_audio=True, file_extension='mp4').first()\n","\n","audio_stream.download(filename='ytaudio.mp4')\n"," \n"]},{"cell_type":"code","execution_count":59,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"zUfk3DWo12yb","outputId":"6c096dd2-3617-41ba-9546-0fdb669bcc8f","executionInfo":{"status":"ok","timestamp":1684341940968,"user_tz":-330,"elapsed":60147,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[{"output_type":"stream","name":"stdout","text":["ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers\n"," built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)\n"," configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared\n"," libavutil 56. 31.100 / 56. 31.100\n"," libavcodec 58. 54.100 / 58. 54.100\n"," libavformat 58. 29.100 / 58. 29.100\n"," libavdevice 58. 8.100 / 58. 8.100\n"," libavfilter 7. 57.100 / 7. 57.100\n"," libavresample 4. 0. 0 / 4. 0. 0\n"," libswscale 5. 5.100 / 5. 5.100\n"," libswresample 3. 5.100 / 3. 5.100\n"," libpostproc 55. 5.100 / 55. 5.100\n","Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'ytaudio.mp4':\n"," Metadata:\n"," major_brand : dash\n"," minor_version : 0\n"," compatible_brands: iso6mp41\n"," creation_time : 2023-04-19T02:49:07.000000Z\n"," Duration: 00:17:12.59, start: 0.000000, bitrate: 48 kb/s\n"," Stream #0:0(und): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 0 kb/s (default)\n"," Metadata:\n"," creation_time : 2023-04-19T02:49:07.000000Z\n"," handler_name : ISO Media file produced by Google Inc.\n","File 'ytaudio1.wav' already exists. Overwrite ? [y/N] ^C\n"]}],"source":["! ffmpeg -i ytaudio.mp4 -acodec pcm_s16le -ar 16000 ytaudio1.wav"]},{"cell_type":"markdown","metadata":{"id":"5CqgQmI62RcX"},"source":["# English ASR\n"]},{"cell_type":"code","execution_count":61,"metadata":{"id":"UkfBQrUN2Vjr","executionInfo":{"status":"ok","timestamp":1684341947537,"user_tz":-330,"elapsed":6571,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[],"source":["!pip install huggingsound -q "]},{"cell_type":"code","execution_count":63,"metadata":{"id":"XkUnx8ZU2WlJ","executionInfo":{"status":"ok","timestamp":1684341953013,"user_tz":-330,"elapsed":13,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[],"source":["from huggingsound import SpeechRecognitionModel\n"]},{"cell_type":"code","execution_count":64,"metadata":{"id":"Jj7WcGRx5NvJ","executionInfo":{"status":"ok","timestamp":1684341956309,"user_tz":-330,"elapsed":11,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[],"source":["import torch\n","device = \"cuda\" if torch.cuda.is_available() else \"cpu\""]},{"cell_type":"code","execution_count":65,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":35},"id":"cZYiuhenEtzD","outputId":"04ec6d60-2d25-43eb-9175-bdfc9c041989","executionInfo":{"status":"ok","timestamp":1684341957311,"user_tz":-330,"elapsed":514,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":["'cuda'"],"application/vnd.google.colaboratory.intrinsic+json":{"type":"string"}},"metadata":{},"execution_count":65}],"source":["device"]},{"cell_type":"code","execution_count":66,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"2EisvBe52ZHO","outputId":"d6c44be4-94d4-43b2-ae57-0168af99ada0","executionInfo":{"status":"ok","timestamp":1684341975833,"user_tz":-330,"elapsed":14256,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[{"output_type":"stream","name":"stderr","text":["INFO:huggingsound.speech_recognition.model:Loading model...\n"]}],"source":["model = SpeechRecognitionModel(\"jonatasgrosman/wav2vec2-large-xlsr-53-english\", device=device)\n","\n"]},{"cell_type":"markdown","metadata":{"id":"LX4o4edBE_7g"},"source":["OUT OF MEMORY (OOM) error"]},{"cell_type":"markdown","metadata":{"id":"FqmMi7VMq3kq"},"source":["# Audio Chunking"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"47leIDcR1LsQ"},"outputs":[],"source":["import librosa"]},{"cell_type":"code","execution_count":68,"metadata":{"id":"lm67x4AX3L57","executionInfo":{"status":"ok","timestamp":1684341991155,"user_tz":-330,"elapsed":469,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[],"source":["input_file = '/content/ytaudio1.wav'"]},{"cell_type":"code","execution_count":69,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"6NGzeYGr3IZA","outputId":"8e648daf-1e8a-478a-f002-e023275e01de","executionInfo":{"status":"ok","timestamp":1684341994126,"user_tz":-330,"elapsed":10,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[{"output_type":"stream","name":"stdout","text":["16000\n"]}],"source":["print(librosa.get_samplerate(input_file))\n","\n","\n","stream = librosa.stream(\n"," input_file,\n"," block_length=30,\n"," frame_length=16000,\n"," hop_length=16000\n",")"]},{"cell_type":"code","execution_count":70,"metadata":{"id":"YmlYH6ag32bj","executionInfo":{"status":"ok","timestamp":1684341996833,"user_tz":-330,"elapsed":4,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[],"source":["import soundfile as sf\n"]},{"cell_type":"code","execution_count":71,"metadata":{"id":"Yj1wf18l3QJJ","executionInfo":{"status":"ok","timestamp":1684342000314,"user_tz":-330,"elapsed":882,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[],"source":["for i,speech in enumerate(stream):\n"," sf.write(f'{i}.wav', speech, 16000)"]},{"cell_type":"code","execution_count":72,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"oTMcAuRgH3DI","outputId":"922635ff-4294-4160-f58b-18c2c07314ab","executionInfo":{"status":"ok","timestamp":1684342000316,"user_tz":-330,"elapsed":13,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":["34"]},"metadata":{},"execution_count":72}],"source":["i"]},{"cell_type":"markdown","metadata":{"id":"Y5H4Uyoy9jF9"},"source":["# Audio Transcription / ASR / Speech to Text"]},{"cell_type":"code","execution_count":73,"metadata":{"id":"s8a8Mr4R6ndX","executionInfo":{"status":"ok","timestamp":1684342003114,"user_tz":-330,"elapsed":6,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[],"source":["audio_path =[]\n","for a in range(i+1):\n"," audio_path.append(f'/content/{a}.wav') "]},{"cell_type":"code","execution_count":74,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"spXDc1r88RPn","outputId":"6f8987fe-91b8-4754-a043-7a0942bc6fd8","executionInfo":{"status":"ok","timestamp":1684342006529,"user_tz":-330,"elapsed":15,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":["['/content/0.wav',\n"," '/content/1.wav',\n"," '/content/2.wav',\n"," '/content/3.wav',\n"," '/content/4.wav',\n"," '/content/5.wav',\n"," '/content/6.wav',\n"," '/content/7.wav',\n"," '/content/8.wav',\n"," '/content/9.wav',\n"," '/content/10.wav',\n"," '/content/11.wav',\n"," '/content/12.wav',\n"," '/content/13.wav',\n"," '/content/14.wav',\n"," '/content/15.wav',\n"," '/content/16.wav',\n"," '/content/17.wav',\n"," '/content/18.wav',\n"," '/content/19.wav',\n"," '/content/20.wav',\n"," '/content/21.wav',\n"," '/content/22.wav',\n"," '/content/23.wav',\n"," '/content/24.wav',\n"," '/content/25.wav',\n"," '/content/26.wav',\n"," '/content/27.wav',\n"," '/content/28.wav',\n"," '/content/29.wav',\n"," '/content/30.wav',\n"," '/content/31.wav',\n"," '/content/32.wav',\n"," '/content/33.wav',\n"," '/content/34.wav']"]},"metadata":{},"execution_count":74}],"source":["audio_path"]},{"cell_type":"code","execution_count":75,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"DYLKuZ1g2kmL","outputId":"b56063d1-3799-49fe-9126-d6e309fb05ab","executionInfo":{"status":"ok","timestamp":1684342030059,"user_tz":-330,"elapsed":18806,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[{"output_type":"stream","name":"stderr","text":["100%|██████████| 35/35 [00:18<00:00, 1.85it/s]\n"]}],"source":["transcriptions = model.transcribe(audio_path)"]},{"cell_type":"code","execution_count":76,"metadata":{"id":"bbzcKziD9aYx","executionInfo":{"status":"ok","timestamp":1684342030059,"user_tz":-330,"elapsed":41,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[],"source":["full_transcript = \"\"\" \"\"\" "]},{"cell_type":"code","execution_count":77,"metadata":{"id":"C2Vi7kXw2xGo","executionInfo":{"status":"ok","timestamp":1684342030060,"user_tz":-330,"elapsed":39,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[],"source":["for item in transcriptions:\n"," full_transcript += ''.join(item['transcription'])"]},{"cell_type":"code","execution_count":78,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"2LKBXZrk5ima","outputId":"33c1630f-ec9f-45ea-853e-c03e94ef9574","executionInfo":{"status":"ok","timestamp":1684342030060,"user_tz":-330,"elapsed":36,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[{"output_type":"execute_result","data":{"text/plain":["10829"]},"metadata":{},"execution_count":78}],"source":["len(full_transcript)"]},{"cell_type":"code","source":["print(full_transcript)"],"metadata":{"id":"yxY-G2YaRN4S","outputId":"a89b9e5e-7b06-4e3c-f3e1-922ed27eee41","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1684336967551,"user_tz":-330,"elapsed":55,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"execution_count":null,"outputs":[{"output_type":"stream","name":"stdout","text":[" soetimes you ned to get knocked now before you can really figure outfighting its and how you need tho fight itsometies you need to feel the pain and sting of eat to activate the real passion and purpose that got predestined inside of yougod says and jeremia i know the plans i have for youans to prosper you and not to harm you plans to give you hope etar future hear me well on this day this day we you have reached te hilltime and you are deciding on on next jobs next steps careers further education you would rather find purpose than a job or careerpurpose crosses disciplines purpose is an suelement of you it is the reason you're only planet at this particular time in history your very existence is wrapped up in the things you are hurtiful fiel whatever you choose for careerpath remember the struggles along the way are only ment to shape you for your purposewhen god has something for you doesn't matter who stands against itif it submit for yougod will mosomeone is holding you back away from the doorand put someone there who will open it for youi don't know what your future is but if you're willing to take the harter way the more complicated one the one with more failures at first this successes the one that has ultimately proved to have more meaning mat victory more glory you will not regret itpresson with pride empresson with purpose and appreciate whit god has brought u\n"]}]},{"cell_type":"markdown","source":["\n","\n","```\n","# This is formatted as code\n","```\n","\n","**TRANSCRIPT CORRECTION(FOR LINGUISTIC AND SPELLING ERRORS)**"],"metadata":{"id":"Ac8fKWQm6GHl"}},{"cell_type":"code","execution_count":80,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":400},"id":"FH8QJF3O9-IN","outputId":"9d55cfad-e82a-4478-acfa-00e77ea8b86b","executionInfo":{"status":"error","timestamp":1684342074236,"user_tz":-330,"elapsed":2456,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}}},"outputs":[{"output_type":"stream","name":"stderr","text":["Token indices sequence length is longer than the specified maximum sequence length for this model (2542 > 1024). Running this sequence through the model will result in indexing errors\n"]},{"output_type":"error","ename":"IndexError","evalue":"ignored","traceback":["\u001b[0;31m---------------------------------------------------------------------------\u001b[0m","\u001b[0;31mIndexError\u001b[0m Traceback (most recent call last)","\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mfix_spelling\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpipeline\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"text2text-generation\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"oliverguhr/spelling-correction-english-base\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mfixed_spelling\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfix_spelling\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfull_transcript\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mmax_length\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m4569\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 6\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfixed_spelling\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/pipelines/text2text_generation.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 163\u001b[0m \"\"\"\n\u001b[1;32m 164\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 165\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__call__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 166\u001b[0m if (\n\u001b[1;32m 167\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/pipelines/base.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, inputs, num_workers, batch_size, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1117\u001b[0m )\n\u001b[1;32m 1118\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1119\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_single\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpreprocess_params\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mforward_params\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpostprocess_params\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1120\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1121\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mrun_multi\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpreprocess_params\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mforward_params\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpostprocess_params\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/pipelines/base.py\u001b[0m in \u001b[0;36mrun_single\u001b[0;34m(self, inputs, preprocess_params, forward_params, postprocess_params)\u001b[0m\n\u001b[1;32m 1124\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mrun_single\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpreprocess_params\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mforward_params\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpostprocess_params\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1125\u001b[0m \u001b[0mmodel_inputs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpreprocess\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mpreprocess_params\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1126\u001b[0;31m \u001b[0mmodel_outputs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel_inputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mforward_params\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1127\u001b[0m \u001b[0moutputs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpostprocess\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel_outputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mpostprocess_params\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1128\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0moutputs\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/pipelines/base.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, model_inputs, **forward_params)\u001b[0m\n\u001b[1;32m 1023\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0minference_context\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1024\u001b[0m \u001b[0mmodel_inputs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_ensure_tensor_on_device\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel_inputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdevice\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1025\u001b[0;31m \u001b[0mmodel_outputs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_forward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel_inputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mforward_params\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1026\u001b[0m \u001b[0mmodel_outputs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_ensure_tensor_on_device\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel_outputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdevice\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"cpu\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1027\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/pipelines/text2text_generation.py\u001b[0m in \u001b[0;36m_forward\u001b[0;34m(self, model_inputs, **generate_kwargs)\u001b[0m\n\u001b[1;32m 185\u001b[0m \u001b[0mgenerate_kwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"max_length\"\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mgenerate_kwargs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"max_length\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconfig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmax_length\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 186\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcheck_inputs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minput_length\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgenerate_kwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"min_length\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgenerate_kwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"max_length\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 187\u001b[0;31m \u001b[0moutput_ids\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgenerate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mmodel_inputs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mgenerate_kwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 188\u001b[0m \u001b[0mout_b\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0moutput_ids\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 189\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mframework\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m\"pt\"\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/torch/autograd/grad_mode.py\u001b[0m in \u001b[0;36mdecorate_context\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 25\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mdecorate_context\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 26\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclone\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 27\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 28\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mcast\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mF\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdecorate_context\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 29\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/generation/utils.py\u001b[0m in \u001b[0;36mgenerate\u001b[0;34m(self, inputs, generation_config, logits_processor, stopping_criteria, prefix_allowed_tokens_fn, synced_gpus, assistant_model, streamer, **kwargs)\u001b[0m\n\u001b[1;32m 1320\u001b[0m \u001b[0;31m# if model is encoder decoder encoder_outputs are created\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1321\u001b[0m \u001b[0;31m# and added to `model_kwargs`\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1322\u001b[0;31m model_kwargs = self._prepare_encoder_decoder_kwargs_for_generation(\n\u001b[0m\u001b[1;32m 1323\u001b[0m \u001b[0minputs_tensor\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel_kwargs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel_input_name\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1324\u001b[0m )\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/generation/utils.py\u001b[0m in \u001b[0;36m_prepare_encoder_decoder_kwargs_for_generation\u001b[0;34m(self, inputs_tensor, model_kwargs, model_input_name)\u001b[0m\n\u001b[1;32m 636\u001b[0m \u001b[0mencoder_kwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"return_dict\"\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 637\u001b[0m \u001b[0mencoder_kwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mmodel_input_name\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0minputs_tensor\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 638\u001b[0;31m \u001b[0mmodel_kwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"encoder_outputs\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mModelOutput\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mencoder\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mencoder_kwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 639\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 640\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mmodel_kwargs\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *input, **kwargs)\u001b[0m\n\u001b[1;32m 1128\u001b[0m if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks\n\u001b[1;32m 1129\u001b[0m or _global_forward_hooks or _global_forward_pre_hooks):\n\u001b[0;32m-> 1130\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mforward_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1131\u001b[0m \u001b[0;31m# Do not call functions when jit is used\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1132\u001b[0m \u001b[0mfull_backward_hooks\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnon_full_backward_hooks\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/models/bart/modeling_bart.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, input_ids, attention_mask, head_mask, inputs_embeds, output_attentions, output_hidden_states, return_dict)\u001b[0m\n\u001b[1;32m 810\u001b[0m \u001b[0minputs_embeds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0membed_tokens\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minput_ids\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0membed_scale\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 811\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 812\u001b[0;31m \u001b[0membed_pos\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0membed_positions\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 813\u001b[0m \u001b[0membed_pos\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0membed_pos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minputs_embeds\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 814\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *input, **kwargs)\u001b[0m\n\u001b[1;32m 1128\u001b[0m if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks\n\u001b[1;32m 1129\u001b[0m or _global_forward_hooks or _global_forward_pre_hooks):\n\u001b[0;32m-> 1130\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mforward_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1131\u001b[0m \u001b[0;31m# Do not call functions when jit is used\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1132\u001b[0m \u001b[0mfull_backward_hooks\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnon_full_backward_hooks\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/transformers/models/bart/modeling_bart.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, input_ids, past_key_values_length)\u001b[0m\n\u001b[1;32m 138\u001b[0m ).expand(bsz, -1)\n\u001b[1;32m 139\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 140\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpositions\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0moffset\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 141\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 142\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/torch/nn/modules/sparse.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, input)\u001b[0m\n\u001b[1;32m 156\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 157\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mTensor\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mTensor\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 158\u001b[0;31m return F.embedding(\n\u001b[0m\u001b[1;32m 159\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mweight\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpadding_idx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmax_norm\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 160\u001b[0m self.norm_type, self.scale_grad_by_freq, self.sparse)\n","\u001b[0;32m/usr/local/lib/python3.10/dist-packages/torch/nn/functional.py\u001b[0m in \u001b[0;36membedding\u001b[0;34m(input, weight, padding_idx, max_norm, norm_type, scale_grad_by_freq, sparse)\u001b[0m\n\u001b[1;32m 2197\u001b[0m \u001b[0;31m# remove once script supports set_grad_enabled\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2198\u001b[0m \u001b[0m_no_grad_embedding_renorm_\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mweight\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmax_norm\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnorm_type\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2199\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0membedding\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mweight\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpadding_idx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mscale_grad_by_freq\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msparse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2200\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2201\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;31mIndexError\u001b[0m: index out of range in self"]}],"source":["from transformers import pipeline\n","\n","fix_spelling = pipeline(\"text2text-generation\",model=\"oliverguhr/spelling-correction-english-base\")\n","\n","fixed_spelling = fix_spelling(full_transcript,max_length=4569)\n","print(fixed_spelling)"]},{"cell_type":"markdown","source":["transcript error correction"],"metadata":{"id":"te8VjlXg4pVQ"}},{"cell_type":"markdown","metadata":{"id":"Cl6sG6LY-ibU"},"source":["# Text Summarization "]},{"cell_type":"code","execution_count":null,"metadata":{"id":"jtmUwSt2-jj3"},"outputs":[],"source":["from transformers import pipeline"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"wnxBQBAQ-u1B","colab":{"base_uri":"https://localhost:8080/","height":301,"referenced_widgets":["2917cc0709404750950ce9dc554c7a6d","ecbe1c251272425a997e74e19229df23","9b7638c1ed66467eb87656674858d343","836fc35174a349ca809d8b70d7af1cf3","850138e197514a23a231db2f43beeab4","3d91ca58cba447ab9e87c6d8d64cf65c","371bad0d89ee47d481adad8cf53b635d","ec0cded6d2554c28863802deaba5ce0c","49667d0a55de4b158734252c133159d2","b65a0fd61b5444c9b59ad380b43191c1","7b046b50b8114491870af75f8db01844","bc093069a4e44f96838a3cbb786835f8","0ae4bbac6b3c4e38b5b27242b1704b9a","4137729315424d9fb17d9c5cdb3be070","eaff48edfaa14b8d8305563ebf78f77e","ae355060941a4471b6f6bf0b7f5d328d","782962f78d2a425b9c60a0d72c5f0b8c","eaad19c6f86347f0bf2e4d720ff9a4dc","601f5d381b6a47deb92b8f08b8e0028a","78253155b4164e069de871719d2603c4","5ee981cde51b4861af8232f5844ad659","fda80d3ddd63458a8803ba189a78e9bb","cdf5171bcd484c8c985c1c9666a14aed","8376b08bbcfb4774a921240b453ce578","7e6b46db2ce14528888b5362b864beca","e7d751c725c649cc810e6c9200b02cbe","d815158a34cd4e1e9e94855bc529bbd3","e9f09a47317b4a17bce4db9d49b9a0e2","51ece1bfd2b54b9784964fde81a5fe9b","acd6854d40e6481aac3dbf90834cad2d","0c944d59403f4ab1add486a13b11ac0e","9ef6d4f36fdc4469856ba17ebc23f998","4b0ac768539f4f42b12e7373a52d37e0","95c4b4aed4294ecaa54d3573226e70f4","d0125d33d6424c80972345e3319b355c","69ddcf17ca75431f8ddc3b2abd805f59","be52454ca12649d283bd446df7cf2af1","f350c4f187304956a8c6299cb7b9868a","14802a9bce7942a09a4b15576de242e7","5d0ce3d0fa3441ea8554858ba468cfde","2760fa21c0ae41dd8e91ef5a428802ab","20945c1326e24ecabc68c0b36c3bb503","ee9d61de4d614f1cb9332514dd3b1b95","8a405e7cd4f643f08feecc86dff8ea5c","6b40a2b5722b44739c8a3bfe1724c2fd","183f3f0459154619a1490dfd6f60d2a3","447c7ad1c309475999064b65a121b9fd","166f3b8bf19b49b592349f5520c08770","f0ef083cd0754f0eb529424539821b13","deabf6c5f350439d98c9ecc7d1b3b5f4","73030ece25984d3d99aeac558306810b","45ad334d3f2749fbb72b43dd9f1ac786","0af1f36be086483699606ee89e861c90","217173033a00409b8f5881f0af6438d0","6d4095e2664047cfb437a768fa40e1e6"]},"executionInfo":{"status":"ok","timestamp":1684339301530,"user_tz":-330,"elapsed":14195,"user":{"displayName":"gaurav vlogss","userId":"13090030102188813854"}},"outputId":"b8da504a-1056-4aed-ac05-de794e54ace0"},"outputs":[{"output_type":"display_data","data":{"text/plain":["Downloading (…)lve/main/config.json: 0%| | 0.00/1.21k [00:00