Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ def get_similar_links(query, db, embeddings):
|
|
45 |
embedding_vector = get_hugging_face_model()
|
46 |
db = get_db()
|
47 |
st.title("π DSASearch Engine π€ ")
|
48 |
-
text_input = st.
|
49 |
"""
|
50 |
class Solution:
|
51 |
def subsets(self, nums: List[int]) -> List[List[int]]:
|
@@ -59,10 +59,10 @@ class Solution:
|
|
59 |
for j in range(len(nums) + 1):
|
60 |
backtrack(j, 0, [])
|
61 |
return outputs
|
62 |
-
"""
|
63 |
)
|
64 |
button = st.button("Find Similar Questions on Leetcode")
|
65 |
-
if
|
66 |
query = text_input
|
67 |
answer = get_similar_links(query, db, embedding_vector)
|
68 |
for link in set(answer):
|
@@ -73,7 +73,8 @@ else:
|
|
73 |
st.info("Please Input Valid Text")
|
74 |
|
75 |
st.markdown("""
|
76 |
-
|
77 |
-
Source Data : https://github.com/AshwinRachha/LeetCode-Solutions<br />
|
78 |
-
Medium Blog : https://medium.com/@ashwin_rachha/querying-a-code-database-to-find-similar-coding-problems-using-langchain-814730da6e6d<br />
|
79 |
""")
|
|
|
|
|
|
|
|
45 |
embedding_vector = get_hugging_face_model()
|
46 |
db = get_db()
|
47 |
st.title("π DSASearch Engine π€ ")
|
48 |
+
text_input = st.text_area"Enter a Code Example", value =
|
49 |
"""
|
50 |
class Solution:
|
51 |
def subsets(self, nums: List[int]) -> List[List[int]]:
|
|
|
59 |
for j in range(len(nums) + 1):
|
60 |
backtrack(j, 0, [])
|
61 |
return outputs
|
62 |
+
""", height = 330
|
63 |
)
|
64 |
button = st.button("Find Similar Questions on Leetcode")
|
65 |
+
if button:
|
66 |
query = text_input
|
67 |
answer = get_similar_links(query, db, embedding_vector)
|
68 |
for link in set(answer):
|
|
|
73 |
st.info("Please Input Valid Text")
|
74 |
|
75 |
st.markdown("""
|
76 |
+
### Created by Ashwin Rachha.
|
|
|
|
|
77 |
""")
|
78 |
+
st.markdown("Source Data : https://github.com/AshwinRachha/LeetCode-Solutions")
|
79 |
+
st.markdown("Medium Blog : https://medium.com/@ashwin_rachha/querying-a-code-database-to-find-similar-coding-problems-using-langchain-814730da6e6d<br />
|
80 |
+
")
|