Skip to main content

Posts

Showing posts with the label generativeAI

OpenAI Learning:- Chapter 6

  Using Generative AI for Audio/Video Processing: Power of Summarization What Is the Purpose of This Application ? This application is for audio and video summarization. For users who wish to quickly create bullet point summaries of audio/video content, it is a useful tool. Sample code: from langchain.document_loaders import youtube from langchain.text_splitter import RecursiveCharacterTextSplitter import openai import streamlit as st openai.api_key = "<<Add your key here>>" st.set_page_config(page_title= "YouTube Audio/Video Summariser App" ) st.markdown( """<p style="color: #3fd100;font-size: 30px;font-family: sans-serif; text-align:center;margin-bottom:0px;"><b>YouTube Audio/Video </b><span style="color: #3fd100;font-size: 30px;font-family: sans-serif;"><b>Summariser App</b></span></p><p></p>""" , unsafe_allow_html= True ) st.head

OpenAI Learning:- Chapter 5

  Generative AI-Powered Audio/Video Processing: Whisper's Python Adventure What Is the Purpose of This Application? An application that displays the ability of Generative AI to process and analyze audio/video files, and then output the lyrics for that audio or video file. Sample code: import streamlit as st from pytube import YouTube import os import torch from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline def get_mp3(url):     yt = YouTube(str(url))     audio = yt.streams.filter(only_audio = True ).first()     destination = '.'     out_file = audio.download(output_path=destination)     base, ext = os.path.splitext(out_file)     new_file = base + '.mp3'     os.rename(out_file, new_file)     return new_file def get_transcript(audio_file):     device = "cuda:0" if torch.cuda.is_available() else "cpu"   #If you have GPU else it will use cpu     torch_dtype = torch.float16 if torch.cuda.is_available() els