Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ def is_valid_math_question(text):
|
|
58 |
def retrieve_from_qdrant(query):
|
59 |
print("Retrieving context from Qdrant...")
|
60 |
query_vector = embedding_model.encode(query).tolist()
|
61 |
-
hits = qdrant_client.search(collection_name=collection_name, query_vector=query_vector, limit=
|
62 |
print("Retrieved hits:", hits)
|
63 |
return [hit.payload for hit in hits] if hits else []
|
64 |
|
@@ -100,7 +100,7 @@ class MathRetrievalQA(dspy.Program):
|
|
100 |
You are a math textbook author. Write a clear, professional, and well-formatted solution for the following math problem, using proper LaTeX formatting in every step.
|
101 |
|
102 |
Format the following LaTeX-based math solution into a clean, human-readable explanation as found in textbooks. Use standard math symbols like ±, √, fractions with slashes (e.g. (a + b)/c), and superscripts with ^. Do not use LaTeX syntax or backslashes. Do not wrap equations in dollar signs. Present the steps clearly using numbered headings. Keep all fractions in plain text form.
|
103 |
-
|
104 |
|
105 |
|
106 |
|
|
|
58 |
def retrieve_from_qdrant(query):
|
59 |
print("Retrieving context from Qdrant...")
|
60 |
query_vector = embedding_model.encode(query).tolist()
|
61 |
+
hits = qdrant_client.search(collection_name=collection_name, query_vector=query_vector, limit=1)
|
62 |
print("Retrieved hits:", hits)
|
63 |
return [hit.payload for hit in hits] if hits else []
|
64 |
|
|
|
100 |
You are a math textbook author. Write a clear, professional, and well-formatted solution for the following math problem, using proper LaTeX formatting in every step.
|
101 |
|
102 |
Format the following LaTeX-based math solution into a clean, human-readable explanation as found in textbooks. Use standard math symbols like ±, √, fractions with slashes (e.g. (a + b)/c), and superscripts with ^. Do not use LaTeX syntax or backslashes. Do not wrap equations in dollar signs. Present the steps clearly using numbered headings. Keep all fractions in plain text form.
|
103 |
+
Question: {question}
|
104 |
|
105 |
|
106 |
|