Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import gradio as gr
|
| 3 |
-
from streamlit_gradio import st_gradio
|
| 4 |
|
| 5 |
def chat_with_model(input_text):
|
| 6 |
# Call the chat model and return the response
|
|
@@ -25,11 +24,15 @@ def main():
|
|
| 25 |
st.markdown("---")
|
| 26 |
st.write(response)
|
| 27 |
|
| 28 |
-
#
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
if __name__ == "__main__":
|
| 35 |
main()
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import gradio as gr
|
|
|
|
| 3 |
|
| 4 |
def chat_with_model(input_text):
|
| 5 |
# Call the chat model and return the response
|
|
|
|
| 24 |
st.markdown("---")
|
| 25 |
st.write(response)
|
| 26 |
|
| 27 |
+
# Render the Gradio interface using Streamlit's st.form and st.button
|
| 28 |
+
with st.form(key="my_form"):
|
| 29 |
+
text_input = st.text_input("Enter your question")
|
| 30 |
+
submit_button = st.form_submit_button(label="Ask")
|
| 31 |
+
if submit_button:
|
| 32 |
+
with st.spinner("Thinking..."):
|
| 33 |
+
response = chat_with_model(text_input)
|
| 34 |
+
st.markdown("---")
|
| 35 |
+
st.write(response)
|
| 36 |
|
| 37 |
if __name__ == "__main__":
|
| 38 |
main()
|