Spaces:
Sleeping
Sleeping
Commit
·
e2f8627
1
Parent(s):
094ca17
inc chat call
Browse files
app.py
CHANGED
|
@@ -23,14 +23,14 @@ class StreamHandler(BaseCallbackHandler):
|
|
| 23 |
query = st.text_input("input your query", value="Tell me a joke")
|
| 24 |
ask_button = st.button("ask")
|
| 25 |
|
| 26 |
-
st.markdown("###
|
| 27 |
chat_box = st.empty()
|
| 28 |
stream_handler = StreamHandler(chat_box, display_method='write')
|
| 29 |
chat = ChatOpenAI(max_tokens=25, streaming=True, callbacks=[stream_handler])
|
| 30 |
|
| 31 |
#st.markdown("### together box")
|
| 32 |
|
| 33 |
-
|
| 34 |
-
|
| 35 |
# llm_response = response.content
|
| 36 |
# st.markdown(llm_response)
|
|
|
|
| 23 |
query = st.text_input("input your query", value="Tell me a joke")
|
| 24 |
ask_button = st.button("ask")
|
| 25 |
|
| 26 |
+
st.markdown("### GPT-3.5 response")
|
| 27 |
chat_box = st.empty()
|
| 28 |
stream_handler = StreamHandler(chat_box, display_method='write')
|
| 29 |
chat = ChatOpenAI(max_tokens=25, streaming=True, callbacks=[stream_handler])
|
| 30 |
|
| 31 |
#st.markdown("### together box")
|
| 32 |
|
| 33 |
+
if query and ask_button:
|
| 34 |
+
response = chat([HumanMessage(content=query)])
|
| 35 |
# llm_response = response.content
|
| 36 |
# st.markdown(llm_response)
|