Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -138,12 +138,9 @@ section[data-testid="stFileUploader"] small {
|
|
| 138 |
text-align: left;
|
| 139 |
color: #ffffff;
|
| 140 |
}
|
|
|
|
| 141 |
.sources {
|
| 142 |
-
|
| 143 |
-
opacity: 0.7;
|
| 144 |
-
margin-top: 10px;
|
| 145 |
-
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
| 146 |
-
padding-top: 5px;
|
| 147 |
}
|
| 148 |
|
| 149 |
/* 9. TITLE TEXT */
|
|
@@ -268,9 +265,8 @@ FINAL ANSWER:"""
|
|
| 268 |
{"role": "system", "content": "Use only the PDF content."},
|
| 269 |
{"role": "user", "content": prompt}
|
| 270 |
],
|
| 271 |
-
temperature=0.
|
| 272 |
)
|
| 273 |
-
# Returns: (Answer Text, Number of Chunks, Error)
|
| 274 |
return response.choices[0].message.content.strip(), len(docs), None
|
| 275 |
except Exception as e:
|
| 276 |
return None, 0, f"Error: {str(e)}"
|
|
@@ -327,8 +323,8 @@ if submit_btn and user_question:
|
|
| 327 |
with st.spinner("Thinking..."):
|
| 328 |
answer, sources, error = ask_question(user_question)
|
| 329 |
if answer:
|
| 330 |
-
#
|
| 331 |
-
bot_msg =
|
| 332 |
st.session_state.chat.append(("bot", bot_msg))
|
| 333 |
else:
|
| 334 |
st.session_state.chat.append(("bot", f"🔴 **Error:** {error}"))
|
|
|
|
| 138 |
text-align: left;
|
| 139 |
color: #ffffff;
|
| 140 |
}
|
| 141 |
+
/* Sources CSS removed/hidden as it is no longer used */
|
| 142 |
.sources {
|
| 143 |
+
display: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
}
|
| 145 |
|
| 146 |
/* 9. TITLE TEXT */
|
|
|
|
| 265 |
{"role": "system", "content": "Use only the PDF content."},
|
| 266 |
{"role": "user", "content": prompt}
|
| 267 |
],
|
| 268 |
+
temperature=0.0
|
| 269 |
)
|
|
|
|
| 270 |
return response.choices[0].message.content.strip(), len(docs), None
|
| 271 |
except Exception as e:
|
| 272 |
return None, 0, f"Error: {str(e)}"
|
|
|
|
| 323 |
with st.spinner("Thinking..."):
|
| 324 |
answer, sources, error = ask_question(user_question)
|
| 325 |
if answer:
|
| 326 |
+
# CHANGED: Removed the 'Context Chunks Used' HTML from the message
|
| 327 |
+
bot_msg = answer
|
| 328 |
st.session_state.chat.append(("bot", bot_msg))
|
| 329 |
else:
|
| 330 |
st.session_state.chat.append(("bot", f"🔴 **Error:** {error}"))
|