Update README.md
Browse files
README.md
CHANGED
|
@@ -154,10 +154,10 @@ The model was trained to expect an input such as:
|
|
| 154 |
|
| 155 |
```
|
| 156 |
<<<Context>>>
|
| 157 |
-
{
|
| 158 |
|
| 159 |
<<<Query>>>
|
| 160 |
-
{
|
| 161 |
```
|
| 162 |
|
| 163 |
And to output a string of a number between 1-7.
|
|
@@ -180,7 +180,7 @@ from vllm import LLM, SamplingParams
|
|
| 180 |
import numpy as np
|
| 181 |
|
| 182 |
def make_reranker_input(t, q):
|
| 183 |
-
return f"<<<Context>>>\n{
|
| 184 |
|
| 185 |
def make_reranker_inference_conversation(context, question):
|
| 186 |
system_message = "Given a query and a piece of text, output a score of 1-7 based on how related the query is to the text. 1 means least related and 7 is most related."
|
|
@@ -234,7 +234,7 @@ from lmdeploy import GenerationConfig, ChatTemplateConfig, pipeline
|
|
| 234 |
import numpy as np
|
| 235 |
|
| 236 |
def make_reranker_input(t, q):
|
| 237 |
-
return f"<<<Context>>>\n{
|
| 238 |
|
| 239 |
def make_reranker_inference_conversation(context, question):
|
| 240 |
system_message = "Given a query and a piece of text, output a score of 1-7 based on how related the query is to the text. 1 means least related and 7 is most related."
|
|
@@ -299,7 +299,7 @@ client = OpenAI(
|
|
| 299 |
)
|
| 300 |
|
| 301 |
def make_reranker_input(t, q):
|
| 302 |
-
return f"<<<Context>>>\n{
|
| 303 |
|
| 304 |
def make_reranker_inference_conversation(context, question):
|
| 305 |
system_message = "Given a query and a piece of text, output a score of 1-7 based on how related the query is to the text. 1 means least related and 7 is most related."
|
|
|
|
| 154 |
|
| 155 |
```
|
| 156 |
<<<Context>>>
|
| 157 |
+
{your_context_here}
|
| 158 |
|
| 159 |
<<<Query>>>
|
| 160 |
+
{your_query_here}
|
| 161 |
```
|
| 162 |
|
| 163 |
And to output a string of a number between 1-7.
|
|
|
|
| 180 |
import numpy as np
|
| 181 |
|
| 182 |
def make_reranker_input(t, q):
|
| 183 |
+
return f"<<<Context>>>\n{t}\n\n<<<Query>>>\n{q}"
|
| 184 |
|
| 185 |
def make_reranker_inference_conversation(context, question):
|
| 186 |
system_message = "Given a query and a piece of text, output a score of 1-7 based on how related the query is to the text. 1 means least related and 7 is most related."
|
|
|
|
| 234 |
import numpy as np
|
| 235 |
|
| 236 |
def make_reranker_input(t, q):
|
| 237 |
+
return f"<<<Context>>>\n{t}\n\n<<<Query>>>\n{q}"
|
| 238 |
|
| 239 |
def make_reranker_inference_conversation(context, question):
|
| 240 |
system_message = "Given a query and a piece of text, output a score of 1-7 based on how related the query is to the text. 1 means least related and 7 is most related."
|
|
|
|
| 299 |
)
|
| 300 |
|
| 301 |
def make_reranker_input(t, q):
|
| 302 |
+
return f"<<<Context>>>\n{t}\n\n<<<Query>>>\n{q}"
|
| 303 |
|
| 304 |
def make_reranker_inference_conversation(context, question):
|
| 305 |
system_message = "Given a query and a piece of text, output a score of 1-7 based on how related the query is to the text. 1 means least related and 7 is most related."
|