Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
samadpls authored Aug 20, 2024
1 parent e6d9526 commit 474d5c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ def main():
with st.chat_message("assistant"):
with st.spinner("Generating..."):
response = llm_chain.invoke({"input": prompt})
st.markdown(response)
index = response.find("```")
if index != -1:
st.markdown(response[index:])
else:
st.markdown(response)
message = {
"role": "assistant",
"content": response,
Expand Down

0 comments on commit 474d5c4

Please sign in to comment.