Spaces:
Runtime error
Runtime error
Elvan Selvano
commited on
Commit
β’
059d601
1
Parent(s):
8a7c1b4
Fix out of bounds nanosecond timestamp
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ def get_similarity_score(model: SentenceTransformer,
|
|
37 |
"""Get similarity score for each data point and sort by similarity score and last day"""
|
38 |
hits = semantic_search(model, query, corpus_embeddings)
|
39 |
result = pd.merge(data, hits, left_on='ID', right_on='corpus_id')
|
40 |
-
result['Last Day'] = pd.to_datetime(result['Last Day'], format='%d/%m/%Y').dt.date
|
41 |
result.sort_values(by=['score', 'Last Day'], ascending=[False, True], inplace=True)
|
42 |
return result
|
43 |
|
@@ -127,11 +127,6 @@ def main():
|
|
127 |
|
128 |
if submitted:
|
129 |
print(job_title + ',' + str(pd.Timestamp.now()))
|
130 |
-
|
131 |
-
# Logs data to text file
|
132 |
-
# with open('logs.txt', 'a', encoding='utf-8') as f:
|
133 |
-
# f.write(job_title + ',' + str(pd.Timestamp.now()) + '\n')
|
134 |
-
|
135 |
st.info(f'Showing most similar results for {job_title}...')
|
136 |
result = get_similarity_score(model, data, job_title, corpus_embeddings)
|
137 |
result = result[columns]
|
|
|
37 |
"""Get similarity score for each data point and sort by similarity score and last day"""
|
38 |
hits = semantic_search(model, query, corpus_embeddings)
|
39 |
result = pd.merge(data, hits, left_on='ID', right_on='corpus_id')
|
40 |
+
result['Last Day'] = pd.to_datetime(result['Last Day'], format='%d/%m/%Y', errors='coerce').dt.date
|
41 |
result.sort_values(by=['score', 'Last Day'], ascending=[False, True], inplace=True)
|
42 |
return result
|
43 |
|
|
|
127 |
|
128 |
if submitted:
|
129 |
print(job_title + ',' + str(pd.Timestamp.now()))
|
|
|
|
|
|
|
|
|
|
|
130 |
st.info(f'Showing most similar results for {job_title}...')
|
131 |
result = get_similarity_score(model, data, job_title, corpus_embeddings)
|
132 |
result = result[columns]
|