deeksonparlma commited on
Commit ·
b608be2
1
Parent(s): 3cae971
updates
Browse files51 unmodified lines52535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113251 unmodified linesresults_index = np.argmax(results)tag = labels[results_index]for tg in data["intents"]:if tg['tag'] == tag:responses = tg['responses']# print(random.choice(responses))response = random.choice(responses)history.append((message, response))return history, historychatbot = gr.Chatbot(label="Chat")css = """footer {display:none !important}.output-markdown{display:none !important}.gr-button-primary {z-index: 14;height: 43px;width: 130px;left: 0px;top: 0px;padding: 0px;cursor: pointer !important;background: none rgb(17, 20, 45) !important;border: none !important;text-align: center !important;font-family: Poppins !important;font-size: 14px !important;font-weight: 500 !important;color: rgb(255, 255, 255) !important;line-height: 1 !important;border-radius: 12px !important;transition: box-shadow 200ms ease 0s, background 200ms ease 0s !important;box-shadow: none !important;}.gr-button-primary:hover{z-index: 14;height: 43px;width: 130px;left: 0px;top: 0px;padding: 0px;cursor: pointer !important;background: none rgb(37, 56, 133) !important;border: none !important;text-align: center !important;font-family: Poppins !important;font-size: 14px !important;font-weight: 500 !important;color: rgb(255, 255, 255) !important;line-height: 1 !important;border-radius: 12px !important;transition: box-shadow 200ms ease 0s, background 200ms ease 0s !important;box-shadow: rgb(0 0 0 / 23%) 0px 1px 7px 0px !important;}.hover\:bg-orange-50:hover {--tw-bg-opacity: 1 !important;background-color: rgb(229,225,255) !important;}div[data-testid="user"] {background-color: #253885 !important;}.h-\[40vh\]{height: 70vh !important;}"""demo = gr.Interface(chat,[gr.Textbox(lines=1, label="Message"), "state"],[chatbot, "state"],allow_flagging="never",title="Mental Health Bot | Data Science Dojo",css=css)if __name__ == "__main__":demo.launch()51 unmodified lines5253545556575859606162636465666768697071727374757651 unmodified linesresults_index = np.argmax(results)tag = labels[results_index]return tag# for tg in data["intents"]:# if tg['tag'] == tag:# responses = tg['responses']# # print(random.choice(responses))# response = random.choice(responses)# history.append((message, response))# return history, historychatbot = gr.Chatbot(label="Chat")demo = gr.Interface(chat,[gr.Textbox(lines=1, label="Message"), "state"],[chatbot, "state"],allow_flagging="never",title="Tabibu | Mental Health Bot",)if __name__ == "__main__":demo.launch()
app.py+10-66