Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -28,19 +28,7 @@ with st.sidebar:
|
|
28 |
""")
|
29 |
|
30 |
# Example:
|
31 |
-
|
32 |
-
sample_prompt = "What is Large Language Model?"
|
33 |
-
else:
|
34 |
-
sample_prompt = None
|
35 |
-
if st.button("Sample: Explain machine learning on high level terms."):
|
36 |
-
sample_prompt = "Explain machine learning on high level terms."
|
37 |
-
else:
|
38 |
-
sample_prompt = None
|
39 |
-
if st.button("Sample: What is supervised learning? And what data do I need?"):
|
40 |
-
sample_prompt = "What is supervised learning? And what data do I need?"
|
41 |
-
else:
|
42 |
-
sample_prompt = None
|
43 |
-
|
44 |
|
45 |
# Add a button to clear the session state
|
46 |
if st.button("Clear Session"):
|
@@ -73,19 +61,4 @@ if prompt := st.chat_input("What is up?"):
|
|
73 |
st.markdown(response)
|
74 |
# Add assistant response to chat history
|
75 |
st.session_state.messages.append({"role": "assistant", "content": response})
|
76 |
-
elif sample_prompt is not None:
|
77 |
-
prompt = sample_prompt
|
78 |
-
# Display user message in chat message container
|
79 |
-
st.chat_message("user").markdown(prompt)
|
80 |
-
# Add user message to chat history
|
81 |
-
st.session_state.messages.append({"role": "user", "content": prompt})
|
82 |
-
|
83 |
-
response = call_llama(prompt)
|
84 |
|
85 |
-
# Display assistant response in chat message container
|
86 |
-
with st.chat_message("assistant"):
|
87 |
-
st.markdown(response)
|
88 |
-
# Add assistant response to chat history
|
89 |
-
st.session_state.messages.append({"role": "assistant", "content": response})
|
90 |
-
else:
|
91 |
-
continue
|
|
|
28 |
""")
|
29 |
|
30 |
# Example:
|
31 |
+
st.success("Example: Explain what is supervised learning.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
# Add a button to clear the session state
|
34 |
if st.button("Clear Session"):
|
|
|
61 |
st.markdown(response)
|
62 |
# Add assistant response to chat history
|
63 |
st.session_state.messages.append({"role": "assistant", "content": response})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|