abhiixxhek commited on
Commit
251f17c
·
verified ·
1 Parent(s): 7edf31d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py CHANGED
@@ -4,6 +4,24 @@ import pandas as pd
4
  import gradio as gr
5
  from groq import Groq
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  # Step 1: Scrape the free courses from Analytics Vidhya
8
  url = "https://courses.analyticsvidhya.com/pages/all-free-courses"
9
  response = requests.get(url)
 
4
  import gradio as gr
5
  from groq import Groq
6
 
7
+ import os
8
+ from groq import Groq
9
+ from bs4 import BeautifulSoup
10
+ import requests
11
+ import pandas as pd
12
+ import gradio as gr
13
+
14
+ # Access the GROQ_API_KEY from environment variables
15
+ api_key = os.getenv("GROQ_API_KEY")
16
+ if not api_key:
17
+ raise ValueError("GROQ_API_KEY environment variable is not set.")
18
+
19
+ # Initialize Groq client with the API key
20
+ client = Groq(api_key=api_key)
21
+
22
+ # Rest of your code remains the same...
23
+
24
+
25
  # Step 1: Scrape the free courses from Analytics Vidhya
26
  url = "https://courses.analyticsvidhya.com/pages/all-free-courses"
27
  response = requests.get(url)