Spaces:
Sleeping
Sleeping
datnguyentien204
commited on
Commit
•
72fb6a8
1
Parent(s):
c32b90c
Update pages/🤖 Medical Question Answering.py
Browse files
pages/🤖 Medical Question Answering.py
CHANGED
@@ -67,19 +67,10 @@ def get_conversational_chain():
|
|
67 |
# Function to handle user input
|
68 |
# Function to handle user input
|
69 |
def user_input(user_question):
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
# response = chain({"input_documents": docs, "question": user_question}, return_only_outputs=True)
|
75 |
-
|
76 |
-
# return response["output_text"] # Return the answer as a string
|
77 |
-
chain = get_conversational_chain()
|
78 |
-
response = chain({"input_documents": [], "question": user_question}, return_only_outputs=True)
|
79 |
-
|
80 |
-
return response["output_text"]
|
81 |
-
|
82 |
-
|
83 |
|
84 |
# Streamlit UI setup
|
85 |
st.markdown("<h1 style='text-align: center;'>Chào mừng tới Medical Question Answering 🎈</h1>", unsafe_allow_html=True)
|
|
|
67 |
# Function to handle user input
|
68 |
# Function to handle user input
|
69 |
def user_input(user_question):
|
70 |
+
model = genai.GenerativeModel('gemini-1.5-pro')
|
71 |
+
chat = model.start_chat(history=[])
|
72 |
+
response = chat.send_message(user_question)
|
73 |
+
return response.text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
# Streamlit UI setup
|
76 |
st.markdown("<h1 style='text-align: center;'>Chào mừng tới Medical Question Answering 🎈</h1>", unsafe_allow_html=True)
|