Update app.py
Browse files
app.py
CHANGED
|
@@ -509,43 +509,7 @@ def clean_text(text):
|
|
| 509 |
import re
|
| 510 |
return re.sub(r'[^آ-یa-zA-Z0-9۰-۹,.،؟!؛\s]+', '', text)
|
| 511 |
|
| 512 |
-
|
| 513 |
-
st.markdown("""
|
| 514 |
-
<style>
|
| 515 |
-
.custom-input-container {
|
| 516 |
-
display: flex;
|
| 517 |
-
justify-content: center;
|
| 518 |
-
margin-bottom: 20px;
|
| 519 |
-
}
|
| 520 |
-
.custom-input input {
|
| 521 |
-
font-family: 'B Nazanin', sans-serif;
|
| 522 |
-
font-weight: bold;
|
| 523 |
-
color: white;
|
| 524 |
-
background-color: #262730;
|
| 525 |
-
border: 1px solid #444;
|
| 526 |
-
border-radius: 10px;
|
| 527 |
-
padding: 10px 20px;
|
| 528 |
-
width: 60%;
|
| 529 |
-
text-align: center;
|
| 530 |
-
font-size: 18px;
|
| 531 |
-
}
|
| 532 |
-
</style>
|
| 533 |
-
<div class="custom-input-container">
|
| 534 |
-
<div class="custom-input">
|
| 535 |
-
<input type="text" id="customQuery" placeholder="سؤال خود را وارد کنید:">
|
| 536 |
-
</div>
|
| 537 |
-
</div>
|
| 538 |
-
<script>
|
| 539 |
-
const inputElement = window.parent.document.querySelector("#customQuery");
|
| 540 |
-
if (inputElement) {
|
| 541 |
-
inputElement.addEventListener("change", function() {
|
| 542 |
-
window.parent.postMessage({type: "streamlit:setComponentValue", value: this.value}, "*");
|
| 543 |
-
});
|
| 544 |
-
}
|
| 545 |
-
</script>
|
| 546 |
-
""", unsafe_allow_html=True)
|
| 547 |
-
|
| 548 |
-
query = st.text_input(" ", key="custom_query") # برای گرفتن مقدار واقعی ورودی
|
| 549 |
|
| 550 |
if "chat_history" not in st.session_state:
|
| 551 |
st.session_state.chat_history = []
|
|
|
|
| 509 |
import re
|
| 510 |
return re.sub(r'[^آ-یa-zA-Z0-9۰-۹,.،؟!؛\s]+', '', text)
|
| 511 |
|
| 512 |
+
query = st.chat_input("چطور میتونم کمک کنم؟")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 513 |
|
| 514 |
if "chat_history" not in st.session_state:
|
| 515 |
st.session_state.chat_history = []
|