Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ import re
|
|
5 |
import string
|
6 |
|
7 |
import gradio as gr
|
|
|
8 |
from elasticsearch import Elasticsearch
|
9 |
from elasticsearch_dsl import Search, Q
|
10 |
|
@@ -61,7 +62,7 @@ def search(query, num_results=10):
|
|
61 |
response = phrase_query(query[1:-1], num_results=num_results)
|
62 |
else:
|
63 |
response = match_query(query, num_results=num_results)
|
64 |
-
results = [{"text": hit.content, "repository": f"{hit.repository}/{hit.path}", "license": hit.license[0], "language": hit.language} for hit in response]
|
65 |
return process_results(results)
|
66 |
|
67 |
description = """# <p style="text-align: center;"><span style='color: #e6b800;'>StarCoder:</span> Dataset Search π </p>
|
|
|
5 |
import string
|
6 |
|
7 |
import gradio as gr
|
8 |
+
import nh3
|
9 |
from elasticsearch import Elasticsearch
|
10 |
from elasticsearch_dsl import Search, Q
|
11 |
|
|
|
62 |
response = phrase_query(query[1:-1], num_results=num_results)
|
63 |
else:
|
64 |
response = match_query(query, num_results=num_results)
|
65 |
+
results = [{"text": nh3.clean(hit.content), "repository": f"{hit.repository}/{hit.path}", "license": hit.license[0], "language": hit.language} for hit in response]
|
66 |
return process_results(results)
|
67 |
|
68 |
description = """# <p style="text-align: center;"><span style='color: #e6b800;'>StarCoder:</span> Dataset Search π </p>
|