AyeshaAmeen commited on
Commit
02e7886
1 Parent(s): 93da9a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -3
app.py CHANGED
@@ -123,7 +123,7 @@ def analyze_sentiment(text):
123
  return sentiment_map[sentiment]
124
 
125
  # Ensure the directory exists
126
- output_dir = "/content"
127
  os.makedirs(output_dir, exist_ok=True)
128
 
129
  # Step 7: Download audio from YouTube using yt-dlp
@@ -135,7 +135,7 @@ def download_audio_from_youtube(url):
135
  'preferredcodec': 'wav',
136
  'preferredquality': '192',
137
  }],
138
- 'outtmpl': '/tmp/%(id)s.%(ext)s',
139
  'quiet': True
140
  }
141
  with YoutubeDL(ydl_opts) as ydl:
@@ -207,4 +207,28 @@ def process_meeting(file, url, language):
207
 
208
  return transcription, translated_text, key_points, summary, speaker_details, sentiment
209
 
210
- # Step 9: Launch Gradio
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  return sentiment_map[sentiment]
124
 
125
  # Ensure the directory exists
126
+ output_dir = "./output"
127
  os.makedirs(output_dir, exist_ok=True)
128
 
129
  # Step 7: Download audio from YouTube using yt-dlp
 
135
  'preferredcodec': 'wav',
136
  'preferredquality': '192',
137
  }],
138
+ 'outtmpl': './output/%(id)s.%(ext)s',
139
  'quiet': True
140
  }
141
  with YoutubeDL(ydl_opts) as ydl:
 
207
 
208
  return transcription, translated_text, key_points, summary, speaker_details, sentiment
209
 
210
+ # Step 9: Launch Gradio Interface with Scrollbars
211
+ iface = gr.Interface(
212
+ fn=process_meeting,
213
+ inputs=[
214
+ gr.File(label="Upload Meeting Recording"),
215
+ gr.Textbox(label="Enter Meeting URL"),
216
+ gr.Radio(["english", "urdu"], label="Select Summary Language")
217
+ ],
218
+ outputs=[
219
+ gr.Textbox(label="Transcription", lines=20),
220
+ gr.Textbox(label="Translated Text", lines=20),
221
+ gr.Textbox(label="Key Points", lines=20),
222
+ gr.Textbox(label="Summary", lines=20),
223
+ gr.Textbox(label="Speakers", lines=20),
224
+ gr.Textbox(label="Sentiment", lines=1)
225
+ ],
226
+ title="Smart AI Meeting Assistant",
227
+ description="""
228
+ <div style='text-align: center;'>by Ayesha Ameen & Sana Sadiq</div>
229
+ <br>Upload your meeting recording or enter a publicly accessible URL and choose the summary language (English or Urdu).
230
+ """,
231
+ )
232
+
233
+ if __name__ == "__main__":
234
+ iface.launch(share=True, debug=True)