Skip to content

Commit 63016ec

Browse files
authored
[CodeGen] Aligned the output format and fixed acc benchmark issues. (#1981)
1 parent 2606507 commit 63016ec

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CodeGen/benchmark/accuracy/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ We utilize the [bigcode-evaluation-harness](https://github.com/bigcode-project/b
3434

3535
2. **Install Dependencies:**
3636
```shell
37+
# pip install -r requirements-hpu.txt, if you deploy microservices on the Gaudi.
3738
pip install -r requirements.txt
3839
pip install -e .
3940
```

CodeGen/codegen.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,15 @@ async def handle_request(self, request: Request):
280280

281281
# Get the response from the last node in the runtime graph
282282
last_node = runtime_graph.all_leaves()[-1]
283-
response = result_dict[last_node]["text"]
283+
284+
try:
285+
response = result_dict[last_node]["choices"][0]["text"]
286+
except (KeyError, IndexError, TypeError):
287+
try:
288+
response = result_dict[last_node]["text"]
289+
except (KeyError, TypeError):
290+
response = "Response Error"
291+
284292
choices = []
285293
usage = UsageInfo()
286294
choices.append(

0 commit comments

Comments
 (0)