sachit3071 commited on
Commit
2c9a929
·
1 Parent(s): 1c5c4dc

refactor error

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -108,13 +108,12 @@ def read_json_data(file_path):
108
 
109
  def main():
110
  st.title("Analytics Vidhya Course Scraper")
111
-
112
- query = st.text_input("Enter URL", value=get_domain_link())
 
113
 
114
  if st.button("Fetch Courses"):
115
- url = get_domain_link() + "/collections/courses"
116
- courses_texts = get_course_details(url)
117
-
118
  courses_texts = read_json_data("/content/course_data.json")
119
  documents = get_documents(courses_texts)
120
  embeddings = HuggingFaceEmbeddings(model_name="all-MiniLM-L6-v2")
@@ -123,7 +122,7 @@ def main():
123
 
124
  if docs:
125
  st.success(f"Found {len(docs)} courses!")
126
- st.write("Course Links:")
127
  for i, course in enumerate(docs):
128
  st.write(f"{i+1}. {course.metadata['course_name']}")
129
  st.write(f" -{course.metadata['link']}")
 
108
 
109
  def main():
110
  st.title("Analytics Vidhya Course Scraper")
111
+ url = get_domain_link() + "/collections/courses"
112
+ courses_texts = get_course_details(url)
113
+ query = st.text_input("What do you want to learn today", value="Large language models")
114
 
115
  if st.button("Fetch Courses"):
116
+ st.info("Fetching courses please wait...")
 
 
117
  courses_texts = read_json_data("/content/course_data.json")
118
  documents = get_documents(courses_texts)
119
  embeddings = HuggingFaceEmbeddings(model_name="all-MiniLM-L6-v2")
 
122
 
123
  if docs:
124
  st.success(f"Found {len(docs)} courses!")
125
+ st.write("Course Names and Links:")
126
  for i, course in enumerate(docs):
127
  st.write(f"{i+1}. {course.metadata['course_name']}")
128
  st.write(f" -{course.metadata['link']}")