Pavanreddy007/Meeting_Transcript_Summarization_Gradio
0
1import os2import gradio as gr3from groq import Groq4 5# Initialize client using HF Secrets6client = Groq(api_key=os.getenv("GROQ_API_KEY"))7 8# Core function9def summarize_transcript(user_input):10 if not user_input.strip():11 return "Please enter a transcript."12 13 prompt = f"""14 You are an expert meeting assistant.15 16 Summarize the below transcript and list down the raised question and its answers with concise bullet points.17 Keep it clear, professional, and remove unnecessary details.18 19 Transcript:20 {user_input}21 """22 23 try:24 response = client.chat.completions.create(25 model="llama-3.1-8b-instant",26 messages=[{"role": "user", "content": prompt}]27 )28 29 return response.choices[0].message.content30 31 except Exception as e:32 return f"Error: {str(e)}"33 34 35# UI36demo = gr.Interface(37 fn=summarize_transcript,38 inputs=gr.Textbox(39 lines=10,40 placeholder="Paste your meeting transcript here..."41 ),42 outputs=gr.Textbox(label="Summary"),43 title="๐ Queries and response Summarizer",44 description="Paste the transcript and see the Q&A raised by the team"45)46 47# Launch48demo.launch()