Spaces:
Runtime error
Runtime error
Commit
·
2cf751d
1
Parent(s):
d966901
Change req, test branch
Browse files- app.py +11 -5
- custom.css +4 -4
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -147,7 +147,7 @@ with gr.Blocks(css=customCSS, theme='minatosnow/qaigpt') as demo:
|
|
| 147 |
with gr.Column(min_width=42, scale=1):
|
| 148 |
historyDeleteBtn = gr.Button("🗑️ Delete")
|
| 149 |
with gr.Row():
|
| 150 |
-
with gr.Column(scale=6):
|
| 151 |
set_save_file_name = gr.Textbox(
|
| 152 |
show_label=True,
|
| 153 |
placeholder=None,
|
|
@@ -170,10 +170,12 @@ with gr.Blocks(css=customCSS, theme='minatosnow/qaigpt') as demo:
|
|
| 170 |
with gr.Row():
|
| 171 |
chatbot = gr.Chatbot(show_label=False, elem_classes="chatbot", show_share_button=False, height=650)
|
| 172 |
with gr.Row():
|
| 173 |
-
examples_questions = gr.Dataset(samples=[], components=[user_input], type="index"
|
|
|
|
| 174 |
with gr.Row(elem_classes="chatrow"):
|
| 175 |
with gr.Column(min_width=225, scale=10):
|
| 176 |
-
user_input = gr.Textbox(show_label=False, placeholder="Ask me anything...", container=False
|
|
|
|
| 177 |
|
| 178 |
with gr.Column(min_width=42, scale=1):
|
| 179 |
submitBtn = gr.Button("", elem_classes="btn btn-send tooltip-btn tooltip-content-send")
|
|
@@ -199,6 +201,8 @@ with gr.Blocks(css=customCSS, theme='minatosnow/qaigpt') as demo:
|
|
| 199 |
current_model = get_model(llm_model_name=DEPLOYMENT_ID)
|
| 200 |
current_model.set_user_identifier(user_name)
|
| 201 |
return user_info, user_name, current_model, get_history_names(False, user_name)
|
|
|
|
|
|
|
| 202 |
demo.load(create_greeting, inputs=None, outputs=[user_info, user_name, current_model, history_file_dropdown])
|
| 203 |
|
| 204 |
examples_questions.click(load_example, inputs=[examples_questions, samples], outputs=[user_input])
|
|
@@ -219,8 +223,10 @@ with gr.Blocks(css=customCSS, theme='minatosnow/qaigpt') as demo:
|
|
| 219 |
|
| 220 |
saveHistoryBtn.click(save_chat_history, [current_model, chatbot, set_save_file_name], [status_display])
|
| 221 |
historyRefreshBtn.click(get_history_names, [gr.State(False), user_name], [history_file_dropdown])
|
| 222 |
-
historyDeleteBtn.click(delete_chat_history, [current_model, history_file_dropdown],
|
| 223 |
-
|
|
|
|
|
|
|
| 224 |
|
| 225 |
record_audio.start_recording(None, None, None,
|
| 226 |
_js="""
|
|
|
|
| 147 |
with gr.Column(min_width=42, scale=1):
|
| 148 |
historyDeleteBtn = gr.Button("🗑️ Delete")
|
| 149 |
with gr.Row():
|
| 150 |
+
with gr.Column(scale=6):
|
| 151 |
set_save_file_name = gr.Textbox(
|
| 152 |
show_label=True,
|
| 153 |
placeholder=None,
|
|
|
|
| 170 |
with gr.Row():
|
| 171 |
chatbot = gr.Chatbot(show_label=False, elem_classes="chatbot", show_share_button=False, height=650)
|
| 172 |
with gr.Row():
|
| 173 |
+
examples_questions = gr.Dataset(samples=[], components=[user_input], type="index",
|
| 174 |
+
elem_classes="examples")
|
| 175 |
with gr.Row(elem_classes="chatrow"):
|
| 176 |
with gr.Column(min_width=225, scale=10):
|
| 177 |
+
user_input = gr.Textbox(show_label=False, placeholder="Ask me anything...", container=False,
|
| 178 |
+
elem_classes="user-input")
|
| 179 |
|
| 180 |
with gr.Column(min_width=42, scale=1):
|
| 181 |
submitBtn = gr.Button("", elem_classes="btn btn-send tooltip-btn tooltip-content-send")
|
|
|
|
| 201 |
current_model = get_model(llm_model_name=DEPLOYMENT_ID)
|
| 202 |
current_model.set_user_identifier(user_name)
|
| 203 |
return user_info, user_name, current_model, get_history_names(False, user_name)
|
| 204 |
+
|
| 205 |
+
|
| 206 |
demo.load(create_greeting, inputs=None, outputs=[user_info, user_name, current_model, history_file_dropdown])
|
| 207 |
|
| 208 |
examples_questions.click(load_example, inputs=[examples_questions, samples], outputs=[user_input])
|
|
|
|
| 223 |
|
| 224 |
saveHistoryBtn.click(save_chat_history, [current_model, chatbot, set_save_file_name], [status_display])
|
| 225 |
historyRefreshBtn.click(get_history_names, [gr.State(False), user_name], [history_file_dropdown])
|
| 226 |
+
historyDeleteBtn.click(delete_chat_history, [current_model, history_file_dropdown],
|
| 227 |
+
[status_display, history_file_dropdown, chatbot])
|
| 228 |
+
history_file_dropdown.change(load_chat_history, [current_model, history_file_dropdown],
|
| 229 |
+
[set_save_file_name, chatbot])
|
| 230 |
|
| 231 |
record_audio.start_recording(None, None, None,
|
| 232 |
_js="""
|
custom.css
CHANGED
|
@@ -1003,17 +1003,17 @@ div.logo {
|
|
| 1003 |
justify-content: flex-start;
|
| 1004 |
}
|
| 1005 |
|
| 1006 |
-
|
| 1007 |
font-size: var(--message-font-size) !important;
|
| 1008 |
box-shadow: var(--cib-shadow-card) !important;
|
| 1009 |
outline: transparent solid 1px !important;
|
| 1010 |
}
|
| 1011 |
|
| 1012 |
-
|
| 1013 |
-
background:
|
| 1014 |
}
|
| 1015 |
|
| 1016 |
-
.dark
|
| 1017 |
background: var(--chatbot-background-color-dark) !important;
|
| 1018 |
}
|
| 1019 |
|
|
|
|
| 1003 |
justify-content: flex-start;
|
| 1004 |
}
|
| 1005 |
|
| 1006 |
+
.user-input {
|
| 1007 |
font-size: var(--message-font-size) !important;
|
| 1008 |
box-shadow: var(--cib-shadow-card) !important;
|
| 1009 |
outline: transparent solid 1px !important;
|
| 1010 |
}
|
| 1011 |
|
| 1012 |
+
.examples > div > button > div {
|
| 1013 |
+
background: rgba(249, 249, 249, 0.33) !important;
|
| 1014 |
}
|
| 1015 |
|
| 1016 |
+
.dark .examples > div > button > div {
|
| 1017 |
background: var(--chatbot-background-color-dark) !important;
|
| 1018 |
}
|
| 1019 |
|
requirements.txt
CHANGED
|
@@ -8,4 +8,4 @@ pinecone-client
|
|
| 8 |
google-api-python-client
|
| 9 |
bs4
|
| 10 |
azure-storage-blob
|
| 11 |
-
azure
|
|
|
|
| 8 |
google-api-python-client
|
| 9 |
bs4
|
| 10 |
azure-storage-blob
|
| 11 |
+
azure-cosmos
|