Spaces:
Runtime error
Runtime error
remove markdown in gradio
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ def add_text(history, text):
|
|
15 |
def process_input(history):
|
16 |
inp = history[-1][0]
|
17 |
# response = "I have received your input, which is: \n" + inp
|
18 |
-
if len(history)
|
19 |
chat_bot.reset_context()
|
20 |
response = chat_bot.chat(inp)
|
21 |
history[-1][1] = response
|
@@ -101,10 +101,6 @@ with gr.Blocks() as demo:
|
|
101 |
hf_embed = HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2")
|
102 |
chroma_db = Chroma(collection_name="workplace_docs", embedding_function=hf_embed, persist_directory=workplace_vector_db_path)
|
103 |
chat_bot = ChatBot(chroma_db)
|
104 |
-
gr.Markdown('''
|
105 |
-
## **CareerPal**
|
106 |
-
here to ease your anxiety about your future
|
107 |
-
''')
|
108 |
with gr.Row():
|
109 |
output_box = gr.Chatbot([[None, "Welcome! What can I help you with today?"]], show_label=False).style(height=450)
|
110 |
with gr.Row(): # TODO: Box or Group instead of row?
|
|
|
15 |
def process_input(history):
|
16 |
inp = history[-1][0]
|
17 |
# response = "I have received your input, which is: \n" + inp
|
18 |
+
if len(history) <= 2:
|
19 |
chat_bot.reset_context()
|
20 |
response = chat_bot.chat(inp)
|
21 |
history[-1][1] = response
|
|
|
101 |
hf_embed = HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2")
|
102 |
chroma_db = Chroma(collection_name="workplace_docs", embedding_function=hf_embed, persist_directory=workplace_vector_db_path)
|
103 |
chat_bot = ChatBot(chroma_db)
|
|
|
|
|
|
|
|
|
104 |
with gr.Row():
|
105 |
output_box = gr.Chatbot([[None, "Welcome! What can I help you with today?"]], show_label=False).style(height=450)
|
106 |
with gr.Row(): # TODO: Box or Group instead of row?
|