npc0 commited on
Commit
74210a1
·
verified ·
1 Parent(s): a1efe24

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -54,8 +54,11 @@ if prompt := st.chat_input("What is up?"):
54
  "--method", "global",
55
  prompt
56
  ]
57
- result = subprocess.run(command, capture_output=True, text=True, check=True)
58
- response = result.stdout
 
 
 
59
 
60
  # Display assistant response in chat message container
61
  with st.chat_message("assistant"):
 
54
  "--method", "global",
55
  prompt
56
  ]
57
+ try:
58
+ result = subprocess.run(command, capture_output=True, text=True, check=True)
59
+ response = result.stdout
60
+ except subprocess.CalledProcessError as e:
61
+ response = e.output
62
 
63
  # Display assistant response in chat message container
64
  with st.chat_message("assistant"):