Update README.md
Browse files
README.md
CHANGED
@@ -38,20 +38,8 @@ We release the scripts to evaluate our model's performance [here](https://github
|
|
38 |
from sentence_transformers import SentenceTransformer
|
39 |
|
40 |
model = SentenceTransformer("cornstack/CodeRankEmbed", trust_remote_code=True)
|
41 |
-
queries = ['Represent this query for searching relevant code: Calculate the n-th
|
42 |
-
codes = [
|
43 |
-
if n <= 0:
|
44 |
-
return "Input should be a positive integer"
|
45 |
-
elif n == 1:
|
46 |
-
return 0
|
47 |
-
elif n == 2:
|
48 |
-
return 1
|
49 |
-
else:
|
50 |
-
a, b = 0, 1
|
51 |
-
for _ in range(2, n):
|
52 |
-
a, b = b, a + b
|
53 |
-
return b
|
54 |
-
"""]
|
55 |
query_embeddings = model.encode(queries)
|
56 |
print(query_embeddings)
|
57 |
code_embeddings = model.encode(codes)
|
|
|
38 |
from sentence_transformers import SentenceTransformer
|
39 |
|
40 |
model = SentenceTransformer("cornstack/CodeRankEmbed", trust_remote_code=True)
|
41 |
+
queries = ['Represent this query for searching relevant code: Calculate the n-th factorial']
|
42 |
+
codes = ['def fact(n):\n if n < 0:\n raise ValueError\n return 1 if n == 0 else n * fact(n - 1)']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
query_embeddings = model.encode(queries)
|
44 |
print(query_embeddings)
|
45 |
code_embeddings = model.encode(codes)
|