Skip to content

Commit

Permalink
handle invalid output from models
Browse files Browse the repository at this point in the history
  • Loading branch information
qidanrui committed Dec 1, 2023
1 parent 8359ba8 commit b35533e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dbgpt_hub/predict/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def main():

with open(predict_output_dir_name, "w") as f:
for p in result:
f.write(p.replace("\n", " ") + "\n")
try:
f.write(p.replace("\n", " ") + "\n")
except:
f.write("Invalid Output!\n")


if __name__ == "__main__":
Expand Down

0 comments on commit b35533e

Please sign in to comment.