Skip to content

Commit 302df88

Browse files
committed
update
Signed-off-by: Ivy Zhang <[email protected]>
1 parent 1bea6f8 commit 302df88

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

examples/llm-api/quickstart_multimodal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ def main():
228228
# Store generated output
229229
generated_outputs.append({
230230
"turn": i + 1,
231-
"user_input": args.prompt[i],
231+
"user_input": cur_prompt,
232232
"assistant_response": response,
233233
"media": args.media
234234
})
235235

236236
# Add to cur_prompt
237-
cur_prompt = cur_prompt + f"assistant: {response}"
237+
cur_prompt = cur_prompt + response
238238

239239
except Exception as e:
240240
print(f"Error in turn {i+1}: {e}")

tests/integration/defs/test_e2e.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,18 +1584,20 @@ def test_build_time_benchmark_sanity(llm_root, llm_venv):
15841584

15851585

15861586
### PyTorch examples
1587+
1588+
15871589
def parse_output(text):
15881590
results = []
15891591
text_lists = re.split(r"\[\d+\] Prompt:", text)
15901592
for item in text_lists:
15911593
item = item.replace(os.linesep, "")
15921594
while True:
1593-
match = re.search(r"Generated text: [\"'](.*?)[\"']", item,
1595+
match = re.search(r"(Generated text: \'(.*?)\')", item,
15941596
re.MULTILINE)
15951597
if match is None:
15961598
break
15971599
_, end = match.span(1)
1598-
results.append(match.group(1))
1600+
results.append(match.group(2))
15991601
item = item[end:]
16001602
return results
16011603

@@ -2537,8 +2539,8 @@ def test_ptp_quickstart_multimodal_multiturn(llm_root, llm_venv, model_name,
25372539
accuracy_inputs = {
25382540
"image": {
25392541
"prompt": [
2540-
"user: Describe what you see in this image.",
2541-
"user: How would you describe the atmosphere of this scene?",
2542+
"Describe what you see in this image.",
2543+
"How would you describe the atmosphere of this scene?",
25422544
],
25432545
"media": [
25442546
str(test_data_root / "inpaint.png"),

0 commit comments

Comments
 (0)