Spaces:
Build error
Build error
student-abdullah
commited on
Commit
•
080548c
1
Parent(s):
038fb25
Update a.py
Browse files
a.py
CHANGED
@@ -9,7 +9,7 @@ df = pd.read_csv('location.csv', encoding='Windows-1252')
|
|
9 |
|
10 |
# Initialize session state for selected service and chatbot history
|
11 |
if 'selected_service' not in st.session_state:
|
12 |
-
st.session_state.selected_service = "
|
13 |
if 'user_input' not in st.session_state:
|
14 |
st.session_state['user_input'] = ''
|
15 |
|
@@ -49,7 +49,7 @@ llm = LlamaCpp(
|
|
49 |
stop=["###"]
|
50 |
)
|
51 |
|
52 |
-
template = """Below is Question that describes a
|
53 |
|
54 |
### Question:
|
55 |
{}
|
@@ -67,10 +67,10 @@ PROFANE_WORDS = [
|
|
67 |
"knob", "knobhead", "wazzock", "clit", "scrotum", "fanny", "ass", "freak",
|
68 |
"bimbo", "dumbass", "jackass", "wimp", "idiot", "moron", "loser", "fool",
|
69 |
"retard", "cocksucker", "shag", "shagger", "piss off", "go to hell",
|
70 |
-
"
|
71 |
"bhosdike", "bhenchod", "madarchod", "gandu", "gand", "bhancho",
|
72 |
"saala", "kameena", "bhenji", "bhadwa", "kothi", "aankhmar", "launda",
|
73 |
-
"bhikari", "sala", "
|
74 |
"kaamchor", "gaddha", "bakra", "chudiya", "gando", "bhencod", "lanat",
|
75 |
"bhoot", "chakkar", "chutak", "haramkhor", "bandar", "banda", "bakwas",
|
76 |
"nikamma", "pagal", "nalayak", "pagal", "khota", "madharchod"
|
@@ -98,7 +98,7 @@ def truncate_at_full_stop(text, max_length=1024):
|
|
98 |
return truncated
|
99 |
|
100 |
|
101 |
-
if st.session_state.selected_service == "
|
102 |
st.title("MedBot")
|
103 |
|
104 |
user_input = st.text_input("Your Queries:", key='temp_user_input')
|
@@ -113,7 +113,7 @@ if st.session_state.selected_service == "Kendra Locator":
|
|
113 |
response = llm.invoke(formatted_prompt)
|
114 |
|
115 |
truncated_response = truncate_at_full_stop(response)
|
116 |
-
st.markdown(f"**MedBot:** {truncated_response}
|
117 |
|
118 |
|
119 |
st.warning("Developer's notice : Responses are generated by AI and maybe inaccurate or inappropriate. Any received medical or financial consult is not a substitute for professional advice.")
|
|
|
9 |
|
10 |
# Initialize session state for selected service and chatbot history
|
11 |
if 'selected_service' not in st.session_state:
|
12 |
+
st.session_state.selected_service = "Kendr Locator"
|
13 |
if 'user_input' not in st.session_state:
|
14 |
st.session_state['user_input'] = ''
|
15 |
|
|
|
49 |
stop=["###"]
|
50 |
)
|
51 |
|
52 |
+
template = """You are a knowledgeable, conversational assistant. Below is an Question that describes a query. Give out a Response that appropriately completes that query.
|
53 |
|
54 |
### Question:
|
55 |
{}
|
|
|
67 |
"knob", "knobhead", "wazzock", "clit", "scrotum", "fanny", "ass", "freak",
|
68 |
"bimbo", "dumbass", "jackass", "wimp", "idiot", "moron", "loser", "fool",
|
69 |
"retard", "cocksucker", "shag", "shagger", "piss off", "go to hell",
|
70 |
+
"dammit", "son of a bitch", "jerk", "puke", "chut", "chutiyah",
|
71 |
"bhosdike", "bhenchod", "madarchod", "gandu", "gand", "bhancho",
|
72 |
"saala", "kameena", "bhenji", "bhadwa", "kothi", "aankhmar", "launda",
|
73 |
+
"bhikari", "sala", "bhosdika", "kothi", "sundar", "langda",
|
74 |
"kaamchor", "gaddha", "bakra", "chudiya", "gando", "bhencod", "lanat",
|
75 |
"bhoot", "chakkar", "chutak", "haramkhor", "bandar", "banda", "bakwas",
|
76 |
"nikamma", "pagal", "nalayak", "pagal", "khota", "madharchod"
|
|
|
98 |
return truncated
|
99 |
|
100 |
|
101 |
+
if st.session_state.selected_service == "Kendr Locator":
|
102 |
st.title("MedBot")
|
103 |
|
104 |
user_input = st.text_input("Your Queries:", key='temp_user_input')
|
|
|
113 |
response = llm.invoke(formatted_prompt)
|
114 |
|
115 |
truncated_response = truncate_at_full_stop(response)
|
116 |
+
st.markdown(f"**MedBot:** {truncated_response}", unsafe_allow_html=False)
|
117 |
|
118 |
|
119 |
st.warning("Developer's notice : Responses are generated by AI and maybe inaccurate or inappropriate. Any received medical or financial consult is not a substitute for professional advice.")
|