Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -159,13 +159,16 @@ df = pq.read_table("irasuto_items_20210224.parquet").to_pandas()
|
|
159 |
sentence_vectors = np.stack(df["sentence_vector"])
|
160 |
|
161 |
description_text.text("่ชฌๆๆใฎๆๅณใ่ฟใใใใใใจใใ็ปๅใๆค็ดขใใพใใ")
|
|
|
|
|
162 |
query_input = st.text_input(label="่ชฌๆๆ", value="")
|
163 |
search_buttion = st.button("ๆค็ดข")
|
164 |
|
165 |
-
closest_n =
|
166 |
|
167 |
-
if search_buttion:
|
168 |
query = str(query_input)
|
|
|
169 |
query_embedding = model.encode([query]).numpy()
|
170 |
|
171 |
distances = scipy.spatial.distance.cdist(
|
|
|
159 |
sentence_vectors = np.stack(df["sentence_vector"])
|
160 |
|
161 |
description_text.text("่ชฌๆๆใฎๆๅณใ่ฟใใใใใใจใใ็ปๅใๆค็ดขใใพใใ")
|
162 |
+
|
163 |
+
prev_query = ""
|
164 |
query_input = st.text_input(label="่ชฌๆๆ", value="")
|
165 |
search_buttion = st.button("ๆค็ดข")
|
166 |
|
167 |
+
closest_n = 10
|
168 |
|
169 |
+
if search_buttion or prev_query != str(query_input):
|
170 |
query = str(query_input)
|
171 |
+
prev_query = query
|
172 |
query_embedding = model.encode([query]).numpy()
|
173 |
|
174 |
distances = scipy.spatial.distance.cdist(
|