Sayiqa commited on
Commit
41a7e4a
Β·
verified Β·
1 Parent(s): 2906dc3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -147
app.py CHANGED
@@ -252,152 +252,6 @@ def process_youtube_video(url, keywords):
252
 
253
 
254
 
255
- # # Gradio Interface
256
- # with gr.Blocks(theme=gr.themes.Soft()) as app:
257
- # # Login Page
258
- # with gr.Group() as login_page:
259
- # gr.Markdown("# πŸŽ“ Educational Learning Management System")
260
- # username = gr.Textbox(label="Username")
261
- # password = gr.Textbox(label="Password", type="password")
262
- # login_btn = gr.Button("Login", variant="primary")
263
- # login_msg = gr.Markdown()
264
-
265
- # # Main Interface
266
- # with gr.Group(visible=False) as main_page:
267
- # with gr.Row():
268
- # with gr.Column(scale=1):
269
- # gr.Markdown("### πŸ“‹ Navigation")
270
- # nav_dashboard = gr.Button("πŸ“Š Dashboard", variant="primary")
271
- # nav_students = gr.Button("πŸ‘₯ Students")
272
- # nav_teachers = gr.Button("πŸ‘¨β€πŸ« Teachers")
273
- # nav_courses = gr.Button("πŸ“š Courses")
274
- # nav_youtube = gr.Button("πŸŽ₯ YouTube Tool")
275
- # logout_btn = gr.Button("πŸšͺ Logout", variant="stop")
276
-
277
- # with gr.Column(scale=3):
278
- # # Dashboard Content
279
- # dashboard_page = gr.Group()
280
- # with dashboard_page:
281
- # gr.Markdown("## πŸ“Š Dashboard")
282
- # gr.Markdown(f"""
283
- # ### System Overview
284
- # - πŸ‘₯ Total Students: {len(students_data)}
285
- # - πŸ‘¨β€πŸ« Total Teachers: {len(teachers_data)}
286
- # - πŸ“š Total Courses: {len(courses_data)}
287
-
288
- # ### Quick Actions
289
- # - View student performance
290
- # - Access course materials
291
- # - Generate learning insights
292
- # """)
293
-
294
- # # Students Content
295
- # students_page = gr.Group(visible=False)
296
- # with students_page:
297
- # gr.Markdown("## πŸ‘₯ Students")
298
- # gr.DataFrame(
299
- # value=students_data,
300
- # headers=["ID", "Name", "Grade", "Program"]
301
- # )
302
-
303
- # # Teachers Content
304
- # teachers_page = gr.Group(visible=False)
305
- # with teachers_page:
306
- # gr.Markdown("## πŸ‘¨β€πŸ« Teachers")
307
- # gr.DataFrame(
308
- # value=teachers_data,
309
- # headers=["ID", "Name", "Subject", "Qualification"]
310
- # )
311
-
312
- # # Courses Content
313
- # courses_page = gr.Group(visible=False)
314
- # with courses_page:
315
- # gr.Markdown("## πŸ“š Courses")
316
- # gr.DataFrame(
317
- # value=courses_data,
318
- # headers=["ID", "Name", "Instructor", "Level"]
319
- # )
320
-
321
- # # YouTube Tool Content
322
- # youtube_page = gr.Group(visible=False)
323
- # with youtube_page:
324
- # gr.Markdown("## Agent for YouTube Content Exploration")
325
- # with gr.Row():
326
- # with gr.Column(scale=2):
327
- # video_url = gr.Textbox(
328
- # label="YouTube URL",
329
- # placeholder="https://youtube.com/watch?v=..."
330
- # )
331
- # keywords = gr.Textbox(
332
- # label="Keywords for Recommendations",
333
- # placeholder="e.g., python programming, machine learning"
334
- # )
335
- # analyze_btn = gr.Button("πŸ” Analyze Video", variant="primary")
336
-
337
- # with gr.Column(scale=1):
338
- # video_thumbnail = gr.Image(label="Video Preview")
339
-
340
- # with gr.Row():
341
- # with gr.Column():
342
- # summary = gr.Textbox(label="πŸ“ Summary", lines=8)
343
- # sentiment = gr.Textbox(label="😊 Content Sentiment")
344
- # with gr.Column():
345
- # recommendations = gr.Textbox(label="🎯 Related Videos", lines=10)
346
-
347
- # def login_check(user, pwd):
348
- # if USER_CREDENTIALS.get(user) == pwd:
349
- # return {
350
- # login_page: gr.update(visible=False),
351
- # main_page: gr.update(visible=True),
352
- # login_msg: ""
353
- # }
354
- # return {
355
- # login_page: gr.update(visible=True),
356
- # main_page: gr.update(visible=False),
357
- # login_msg: "❌ Invalid credentials"
358
- # }
359
-
360
- # def show_page(page_name):
361
- # updates = {
362
- # dashboard_page: gr.update(visible=False),
363
- # students_page: gr.update(visible=False),
364
- # teachers_page: gr.update(visible=False),
365
- # courses_page: gr.update(visible=False),
366
- # youtube_page: gr.update(visible=False)
367
- # }
368
- # updates[page_name] = gr.update(visible=True)
369
- # return updates
370
-
371
- # # Event Handlers
372
- # login_btn.click(
373
- # login_check,
374
- # inputs=[username, password],
375
- # outputs=[login_page, main_page, login_msg]
376
- # )
377
-
378
- # nav_dashboard.click(lambda: show_page(dashboard_page), outputs=list(show_page(dashboard_page).keys()))
379
- # nav_students.click(lambda: show_page(students_page), outputs=list(show_page(students_page).keys()))
380
- # nav_teachers.click(lambda: show_page(teachers_page), outputs=list(show_page(teachers_page).keys()))
381
- # nav_courses.click(lambda: show_page(courses_page), outputs=list(show_page(courses_page).keys()))
382
- # nav_youtube.click(lambda: show_page(youtube_page), outputs=list(show_page(youtube_page).keys()))
383
-
384
- # analyze_btn.click(
385
- # process_youtube_video,
386
- # inputs=[video_url, keywords],
387
- # outputs=[video_thumbnail, summary, sentiment, recommendations]
388
- # )
389
-
390
- # logout_btn.click(
391
- # lambda: {
392
- # login_page: gr.update(visible=True),
393
- # main_page: gr.update(visible=False)
394
- # },
395
- # outputs=[login_page, main_page]
396
- # )
397
-
398
- # if __name__ == "__main__":
399
- # app.launch()
400
-
401
  # Gradio Interface
402
  with gr.Blocks(theme=gr.themes.Soft()) as app:
403
  # Login Page
@@ -542,4 +396,5 @@ with gr.Blocks(theme=gr.themes.Soft()) as app:
542
  )
543
 
544
  if __name__ == "__main__":
545
- app.launch()
 
 
252
 
253
 
254
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
  # Gradio Interface
256
  with gr.Blocks(theme=gr.themes.Soft()) as app:
257
  # Login Page
 
396
  )
397
 
398
  if __name__ == "__main__":
399
+ app.launch()
400
+