Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -40,14 +40,14 @@ def process_results(results):
|
|
40 |
|
41 |
def match_query(query, num_results=10):
|
42 |
s = Search(using=es, index=os.environ.get("index"))
|
43 |
-
s.query = Q("match",
|
44 |
s = s[:num_results]
|
45 |
response = s.execute()
|
46 |
return response
|
47 |
|
48 |
def phrase_query(query, num_results=10):
|
49 |
s = Search(using=es, index=os.environ.get("index"))
|
50 |
-
s.query = Q("match_phrase",
|
51 |
s = s[:num_results]
|
52 |
response = s.execute()
|
53 |
return response
|
@@ -61,7 +61,7 @@ def search(query, num_results=10):
|
|
61 |
return process_results(results)
|
62 |
|
63 |
|
64 |
-
description = """# <p style="text-align: center; color: white;"><span style='color: #ff75b3;'>StarCoder:</span>
|
65 |
<span style='color: white;'>When you use <a href="https://huggingface.co/bigcode/large-model" style="color: #ff75b3;">StarCoder</a> to generate code it might produce exact copies of code in the pretraining dataset.
|
66 |
In that case, the code license might have requirements to comply with.
|
67 |
With this search tool we aim to provide help to find out where the code came from, in order for the user to comply with licensing requirements in case the code produced by StarCoder belongs to an already existing repository. For exact matches, enclose your query in double quotes.</span>"""
|
|
|
40 |
|
41 |
def match_query(query, num_results=10):
|
42 |
s = Search(using=es, index=os.environ.get("index"))
|
43 |
+
s.query = Q("match", content=query)
|
44 |
s = s[:num_results]
|
45 |
response = s.execute()
|
46 |
return response
|
47 |
|
48 |
def phrase_query(query, num_results=10):
|
49 |
s = Search(using=es, index=os.environ.get("index"))
|
50 |
+
s.query = Q("match_phrase", content=query)
|
51 |
s = s[:num_results]
|
52 |
response = s.execute()
|
53 |
return response
|
|
|
61 |
return process_results(results)
|
62 |
|
63 |
|
64 |
+
description = """# <p style="text-align: center; color: white;"><span style='color: #ff75b3;'>StarCoder:</span> Dataset Search π </p>
|
65 |
<span style='color: white;'>When you use <a href="https://huggingface.co/bigcode/large-model" style="color: #ff75b3;">StarCoder</a> to generate code it might produce exact copies of code in the pretraining dataset.
|
66 |
In that case, the code license might have requirements to comply with.
|
67 |
With this search tool we aim to provide help to find out where the code came from, in order for the user to comply with licensing requirements in case the code produced by StarCoder belongs to an already existing repository. For exact matches, enclose your query in double quotes.</span>"""
|