Spaces:
Sleeping
Sleeping
kartiksrma
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -113,25 +113,24 @@ if st.button("Search"):
|
|
113 |
# Generate query embedding
|
114 |
with st.spinner("Fetching results..."):
|
115 |
results = getSearchResults(query, relevance_threshold)
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
except Exception as e:
|
134 |
-
st.markdown(f"rate limit for searching has been completed try after few minutes\n",e)
|
135 |
else:
|
136 |
st.error("Please enter a query.")
|
137 |
-
|
|
|
113 |
# Generate query embedding
|
114 |
with st.spinner("Fetching results..."):
|
115 |
results = getSearchResults(query, relevance_threshold)
|
116 |
+
if results:
|
117 |
+
for course in results:
|
118 |
+
print(course)
|
119 |
+
st.markdown(
|
120 |
+
f"""
|
121 |
+
### {course['title']}
|
122 |
+
- **Description:** {course['description']}
|
123 |
+
- **Duration:** {course['duration']}
|
124 |
+
- **Ratings:** {course['ratings']}
|
125 |
+
- **Difficulty:** {course['difficulty']}
|
126 |
+
"""
|
127 |
+
)
|
128 |
+
st.markdown(f"[![Go to Course](https://img.shields.io/badge/Go%20to%20Course-blue)]({course['course_url']})",unsafe_allow_html=True,)
|
129 |
+
|
130 |
+
st.markdown("---")
|
131 |
+
else:
|
132 |
+
st.warning("No matches found! Try adjusting the relevance slider or using different keywords.")
|
133 |
+
# except Exception as e:
|
134 |
+
# st.markdown(f"rate limit for searching has been completed try after few minutes\n",e)
|
135 |
else:
|
136 |
st.error("Please enter a query.")
|
|