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