Update README.md
Browse files
README.md
CHANGED
|
@@ -99,13 +99,7 @@ You should store and evaluate model's response as:
|
|
| 99 |
```python
|
| 100 |
# Example code for evaluate
|
| 101 |
def build_question(query):
|
| 102 |
-
question =
|
| 103 |
-
if "prompt" in query:
|
| 104 |
-
question += f"{query['prompt']}\n"
|
| 105 |
-
question += f"{query['question']}\n"
|
| 106 |
-
if "options" in query and len(query["options"]) > 0:
|
| 107 |
-
for option in query["options"]:
|
| 108 |
-
question += f"{option}\n"
|
| 109 |
if "instructions" in query:
|
| 110 |
question += query["instructions"]
|
| 111 |
return question
|
|
@@ -117,7 +111,7 @@ Responses = {}
|
|
| 117 |
|
| 118 |
for query in tqdm(ds):
|
| 119 |
query_idx = query["question_id"]
|
| 120 |
-
|
| 121 |
input_figure = query["url"] # This should be a list of url for models that support url input
|
| 122 |
|
| 123 |
"""
|
|
@@ -129,7 +123,7 @@ for query in tqdm(ds):
|
|
| 129 |
"""
|
| 130 |
|
| 131 |
# Replace with your model
|
| 132 |
-
response = model.generate(
|
| 133 |
|
| 134 |
Responses[query_idx] = {
|
| 135 |
"qtype": int(query["question_type_id"]), # Note that "question_type_id" are used for evaluation only!
|
|
|
|
| 99 |
```python
|
| 100 |
# Example code for evaluate
|
| 101 |
def build_question(query):
|
| 102 |
+
question = query['question']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
if "instructions" in query:
|
| 104 |
question += query["instructions"]
|
| 105 |
return question
|
|
|
|
| 111 |
|
| 112 |
for query in tqdm(ds):
|
| 113 |
query_idx = query["question_id"]
|
| 114 |
+
input_text = build_question(query)
|
| 115 |
input_figure = query["url"] # This should be a list of url for models that support url input
|
| 116 |
|
| 117 |
"""
|
|
|
|
| 123 |
"""
|
| 124 |
|
| 125 |
# Replace with your model
|
| 126 |
+
response = model.generate(input_text, input_figure)
|
| 127 |
|
| 128 |
Responses[query_idx] = {
|
| 129 |
"qtype": int(query["question_type_id"]), # Note that "question_type_id" are used for evaluation only!
|