UMESH266
commited on
Commit
•
694ec5c
1
Parent(s):
33ab516
Docchat repo id updated
Browse files- app.py +1 -1
- artifacts/Audio.mp3 +0 -0
- artifacts/Docmate.ipynb +132 -2
- artifacts/response.txt +1 -3
- logs/10_30_2024_09_04_15.log +69 -0
- requirements.txt +1 -0
- src/components/__pycache__/docchat.cpython-311.pyc +0 -0
- src/components/__pycache__/textprocess.cpython-311.pyc +0 -0
- src/components/docchat.py +2 -1
- src/utils/__pycache__/accessory.cpython-311.pyc +0 -0
app.py
CHANGED
@@ -135,4 +135,4 @@ elif mode == "Voice" and st.session_state.HF_TOKEN != '':
|
|
135 |
break
|
136 |
|
137 |
#Getting response and sentiment of response
|
138 |
-
response(user_input)
|
|
|
135 |
break
|
136 |
|
137 |
#Getting response and sentiment of response
|
138 |
+
response(user_input, docbot=False)
|
artifacts/Audio.mp3
DELETED
Binary file (164 kB)
|
|
artifacts/Docmate.ipynb
CHANGED
@@ -764,11 +764,141 @@
|
|
764 |
"with open(\"Logit_model.pkl\", 'wb') as file:\n",
|
765 |
" pickle.dump(logit_model, file)"
|
766 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
767 |
}
|
768 |
],
|
769 |
"metadata": {
|
770 |
"kernelspec": {
|
771 |
-
"display_name": "
|
772 |
"language": "python",
|
773 |
"name": "python3"
|
774 |
},
|
@@ -782,7 +912,7 @@
|
|
782 |
"name": "python",
|
783 |
"nbconvert_exporter": "python",
|
784 |
"pygments_lexer": "ipython3",
|
785 |
-
"version": "3.
|
786 |
}
|
787 |
},
|
788 |
"nbformat": 4,
|
|
|
764 |
"with open(\"Logit_model.pkl\", 'wb') as file:\n",
|
765 |
" pickle.dump(logit_model, file)"
|
766 |
]
|
767 |
+
},
|
768 |
+
{
|
769 |
+
"cell_type": "code",
|
770 |
+
"execution_count": 1,
|
771 |
+
"metadata": {},
|
772 |
+
"outputs": [
|
773 |
+
{
|
774 |
+
"name": "stderr",
|
775 |
+
"output_type": "stream",
|
776 |
+
"text": [
|
777 |
+
"c:\\Users\\umesh\\anaconda3\\envs\\GenAI\\Lib\\site-packages\\pydub\\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work\n",
|
778 |
+
" warn(\"Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work\", RuntimeWarning)\n",
|
779 |
+
"c:\\Users\\umesh\\anaconda3\\envs\\GenAI\\Lib\\site-packages\\pydub\\utils.py:198: RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work\n",
|
780 |
+
" warn(\"Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work\", RuntimeWarning)\n"
|
781 |
+
]
|
782 |
+
},
|
783 |
+
{
|
784 |
+
"ename": "FileNotFoundError",
|
785 |
+
"evalue": "[WinError 2] The system cannot find the file specified",
|
786 |
+
"output_type": "error",
|
787 |
+
"traceback": [
|
788 |
+
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
789 |
+
"\u001b[1;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
|
790 |
+
"Cell \u001b[1;32mIn[1], line 9\u001b[0m\n\u001b[0;32m 6\u001b[0m langs\u001b[38;5;241m=\u001b[39mtts_langs()\u001b[38;5;241m.\u001b[39mkeys()\n\u001b[0;32m 8\u001b[0m \u001b[38;5;66;03m#get the audio first\u001b[39;00m\n\u001b[1;32m----> 9\u001b[0m audio\u001b[38;5;241m=\u001b[39mtext_to_audio(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mChoose a language, type some text, and click \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mSpeak it out!\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m.\u001b[39m\u001b[38;5;124m\"\u001b[39m,language\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124men\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m 10\u001b[0m \u001b[38;5;66;03m#then play it\u001b[39;00m\n\u001b[0;32m 11\u001b[0m auto_play(audio)\n",
|
791 |
+
"File \u001b[1;32mc:\\Users\\umesh\\anaconda3\\envs\\GenAI\\Lib\\site-packages\\streamlit_TTS\\__init__.py:72\u001b[0m, in \u001b[0;36mtext_to_audio\u001b[1;34m(text, language, cleanup_hook)\u001b[0m\n\u001b[0;32m 69\u001b[0m mp3_buffer\u001b[38;5;241m.\u001b[39mseek(\u001b[38;5;241m0\u001b[39m)\n\u001b[0;32m 71\u001b[0m \u001b[38;5;66;03m# Convert MP3 to WAV and make it mono\u001b[39;00m\n\u001b[1;32m---> 72\u001b[0m audio \u001b[38;5;241m=\u001b[39m AudioSegment\u001b[38;5;241m.\u001b[39mfrom_file(mp3_buffer,\u001b[38;5;28mformat\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmp3\u001b[39m\u001b[38;5;124m\"\u001b[39m)\u001b[38;5;241m.\u001b[39mset_channels(\u001b[38;5;241m1\u001b[39m)\n\u001b[0;32m 74\u001b[0m \u001b[38;5;66;03m# Extract audio properties\u001b[39;00m\n\u001b[0;32m 75\u001b[0m sample_rate \u001b[38;5;241m=\u001b[39m audio\u001b[38;5;241m.\u001b[39mframe_rate\n",
|
792 |
+
"File \u001b[1;32mc:\\Users\\umesh\\anaconda3\\envs\\GenAI\\Lib\\site-packages\\pydub\\audio_segment.py:728\u001b[0m, in \u001b[0;36mAudioSegment.from_file\u001b[1;34m(cls, file, format, codec, parameters, start_second, duration, **kwargs)\u001b[0m\n\u001b[0;32m 726\u001b[0m info \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 727\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m--> 728\u001b[0m info \u001b[38;5;241m=\u001b[39m mediainfo_json(orig_file, read_ahead_limit\u001b[38;5;241m=\u001b[39mread_ahead_limit)\n\u001b[0;32m 729\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m info:\n\u001b[0;32m 730\u001b[0m audio_streams \u001b[38;5;241m=\u001b[39m [x \u001b[38;5;28;01mfor\u001b[39;00m x \u001b[38;5;129;01min\u001b[39;00m info[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mstreams\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[0;32m 731\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m x[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mcodec_type\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124maudio\u001b[39m\u001b[38;5;124m'\u001b[39m]\n",
|
793 |
+
"File \u001b[1;32mc:\\Users\\umesh\\anaconda3\\envs\\GenAI\\Lib\\site-packages\\pydub\\utils.py:274\u001b[0m, in \u001b[0;36mmediainfo_json\u001b[1;34m(filepath, read_ahead_limit)\u001b[0m\n\u001b[0;32m 271\u001b[0m file\u001b[38;5;241m.\u001b[39mclose()\n\u001b[0;32m 273\u001b[0m command \u001b[38;5;241m=\u001b[39m [prober, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m-of\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mjson\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;241m+\u001b[39m command_args\n\u001b[1;32m--> 274\u001b[0m res \u001b[38;5;241m=\u001b[39m Popen(command, stdin\u001b[38;5;241m=\u001b[39mstdin_parameter, stdout\u001b[38;5;241m=\u001b[39mPIPE, stderr\u001b[38;5;241m=\u001b[39mPIPE)\n\u001b[0;32m 275\u001b[0m output, stderr \u001b[38;5;241m=\u001b[39m res\u001b[38;5;241m.\u001b[39mcommunicate(\u001b[38;5;28minput\u001b[39m\u001b[38;5;241m=\u001b[39mstdin_data)\n\u001b[0;32m 276\u001b[0m output \u001b[38;5;241m=\u001b[39m output\u001b[38;5;241m.\u001b[39mdecode(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mutf-8\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mignore\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
|
794 |
+
"File \u001b[1;32mc:\\Users\\umesh\\anaconda3\\envs\\GenAI\\Lib\\subprocess.py:1026\u001b[0m, in \u001b[0;36mPopen.__init__\u001b[1;34m(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)\u001b[0m\n\u001b[0;32m 1022\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtext_mode:\n\u001b[0;32m 1023\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstderr \u001b[38;5;241m=\u001b[39m io\u001b[38;5;241m.\u001b[39mTextIOWrapper(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstderr,\n\u001b[0;32m 1024\u001b[0m encoding\u001b[38;5;241m=\u001b[39mencoding, errors\u001b[38;5;241m=\u001b[39merrors)\n\u001b[1;32m-> 1026\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_execute_child(args, executable, preexec_fn, close_fds,\n\u001b[0;32m 1027\u001b[0m pass_fds, cwd, env,\n\u001b[0;32m 1028\u001b[0m startupinfo, creationflags, shell,\n\u001b[0;32m 1029\u001b[0m p2cread, p2cwrite,\n\u001b[0;32m 1030\u001b[0m c2pread, c2pwrite,\n\u001b[0;32m 1031\u001b[0m errread, errwrite,\n\u001b[0;32m 1032\u001b[0m restore_signals,\n\u001b[0;32m 1033\u001b[0m gid, gids, uid, umask,\n\u001b[0;32m 1034\u001b[0m start_new_session, process_group)\n\u001b[0;32m 1035\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m:\n\u001b[0;32m 1036\u001b[0m \u001b[38;5;66;03m# Cleanup if the child failed starting.\u001b[39;00m\n\u001b[0;32m 1037\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mfilter\u001b[39m(\u001b[38;5;28;01mNone\u001b[39;00m, (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstdin, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstdout, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstderr)):\n",
|
795 |
+
"File \u001b[1;32mc:\\Users\\umesh\\anaconda3\\envs\\GenAI\\Lib\\subprocess.py:1538\u001b[0m, in \u001b[0;36mPopen._execute_child\u001b[1;34m(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session, unused_process_group)\u001b[0m\n\u001b[0;32m 1536\u001b[0m \u001b[38;5;66;03m# Start the process\u001b[39;00m\n\u001b[0;32m 1537\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m-> 1538\u001b[0m hp, ht, pid, tid \u001b[38;5;241m=\u001b[39m _winapi\u001b[38;5;241m.\u001b[39mCreateProcess(executable, args,\n\u001b[0;32m 1539\u001b[0m \u001b[38;5;66;03m# no special security\u001b[39;00m\n\u001b[0;32m 1540\u001b[0m \u001b[38;5;28;01mNone\u001b[39;00m, \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[0;32m 1541\u001b[0m \u001b[38;5;28mint\u001b[39m(\u001b[38;5;129;01mnot\u001b[39;00m close_fds),\n\u001b[0;32m 1542\u001b[0m creationflags,\n\u001b[0;32m 1543\u001b[0m env,\n\u001b[0;32m 1544\u001b[0m cwd,\n\u001b[0;32m 1545\u001b[0m startupinfo)\n\u001b[0;32m 1546\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[0;32m 1547\u001b[0m \u001b[38;5;66;03m# Child is launched. Close the parent's copy of those pipe\u001b[39;00m\n\u001b[0;32m 1548\u001b[0m \u001b[38;5;66;03m# handles that only the child should have open. You need\u001b[39;00m\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 1551\u001b[0m \u001b[38;5;66;03m# pipe will not close when the child process exits and the\u001b[39;00m\n\u001b[0;32m 1552\u001b[0m \u001b[38;5;66;03m# ReadFile will hang.\u001b[39;00m\n\u001b[0;32m 1553\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_close_pipe_fds(p2cread, p2cwrite,\n\u001b[0;32m 1554\u001b[0m c2pread, c2pwrite,\n\u001b[0;32m 1555\u001b[0m errread, errwrite)\n",
|
796 |
+
"\u001b[1;31mFileNotFoundError\u001b[0m: [WinError 2] The system cannot find the file specified"
|
797 |
+
]
|
798 |
+
}
|
799 |
+
],
|
800 |
+
"source": [
|
801 |
+
"import streamlit as st\n",
|
802 |
+
"from streamlit_TTS import auto_play, text_to_speech, text_to_audio\n",
|
803 |
+
"\n",
|
804 |
+
"from gtts.lang import tts_langs\n",
|
805 |
+
"\n",
|
806 |
+
"langs=tts_langs().keys()\n",
|
807 |
+
"\n",
|
808 |
+
"#get the audio first\n",
|
809 |
+
"audio=text_to_audio(\"Choose a language, type some text, and click 'Speak it out!'.\", language='en')\n",
|
810 |
+
"#then play it\n",
|
811 |
+
"auto_play(audio)\n",
|
812 |
+
"\n",
|
813 |
+
"lang=st.selectbox(\"Choose a language\",options=langs)\n",
|
814 |
+
"text=st.text_input(\"Choose a text to speak out:\")\n",
|
815 |
+
"speak=st.button(\"Speak it out!\")\n",
|
816 |
+
"\n",
|
817 |
+
"if lang and text and speak:\n",
|
818 |
+
" #plays the audio directly\n",
|
819 |
+
" text_to_speech(text=text, language=lang)"
|
820 |
+
]
|
821 |
+
},
|
822 |
+
{
|
823 |
+
"cell_type": "code",
|
824 |
+
"execution_count": 2,
|
825 |
+
"metadata": {},
|
826 |
+
"outputs": [
|
827 |
+
{
|
828 |
+
"name": "stdout",
|
829 |
+
"output_type": "stream",
|
830 |
+
"text": [
|
831 |
+
"Collecting streamlit-TTS\n",
|
832 |
+
" Using cached streamlit_TTS-0.0.7-py3-none-any.whl.metadata (3.3 kB)\n",
|
833 |
+
"Requirement already satisfied: streamlit>=0.63 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit-TTS) (1.36.0)\n",
|
834 |
+
"Requirement already satisfied: pydub in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit-TTS) (0.25.1)\n",
|
835 |
+
"Requirement already satisfied: gtts in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit-TTS) (2.5.3)\n",
|
836 |
+
"Requirement already satisfied: altair<6,>=4.0 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (4.0.0)\n",
|
837 |
+
"Requirement already satisfied: blinker<2,>=1.0.0 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (1.8.2)\n",
|
838 |
+
"Requirement already satisfied: cachetools<6,>=4.0 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (5.4.0)\n",
|
839 |
+
"Requirement already satisfied: click<9,>=7.0 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (8.1.7)\n",
|
840 |
+
"Requirement already satisfied: numpy<3,>=1.20 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (1.23.5)\n",
|
841 |
+
"Requirement already satisfied: packaging<25,>=20 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (23.2)\n",
|
842 |
+
"Requirement already satisfied: pandas<3,>=1.3.0 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (2.2.1)\n",
|
843 |
+
"Requirement already satisfied: pillow<11,>=7.1.0 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (10.3.0)\n",
|
844 |
+
"Requirement already satisfied: protobuf<6,>=3.20 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (4.25.5)\n",
|
845 |
+
"Requirement already satisfied: pyarrow>=7.0 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (17.0.0)\n",
|
846 |
+
"Requirement already satisfied: requests<3,>=2.27 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (2.32.3)\n",
|
847 |
+
"Requirement already satisfied: rich<14,>=10.14.0 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (13.7.1)\n",
|
848 |
+
"Requirement already satisfied: tenacity<9,>=8.1.0 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (8.5.0)\n",
|
849 |
+
"Requirement already satisfied: toml<2,>=0.10.1 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (0.10.2)\n",
|
850 |
+
"Requirement already satisfied: typing-extensions<5,>=4.3.0 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (4.9.0)\n",
|
851 |
+
"Requirement already satisfied: gitpython!=3.1.19,<4,>=3.0.7 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (3.1.43)\n",
|
852 |
+
"Requirement already satisfied: pydeck<1,>=0.8.0b4 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (0.9.1)\n",
|
853 |
+
"Requirement already satisfied: tornado<7,>=6.0.3 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (6.3.3)\n",
|
854 |
+
"Requirement already satisfied: watchdog<5,>=2.1.5 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from streamlit>=0.63->streamlit-TTS) (4.0.1)\n",
|
855 |
+
"Requirement already satisfied: entrypoints in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from altair<6,>=4.0->streamlit>=0.63->streamlit-TTS) (0.4)\n",
|
856 |
+
"Requirement already satisfied: jinja2 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from altair<6,>=4.0->streamlit>=0.63->streamlit-TTS) (3.1.3)\n",
|
857 |
+
"Requirement already satisfied: jsonschema in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from altair<6,>=4.0->streamlit>=0.63->streamlit-TTS) (4.19.2)\n",
|
858 |
+
"Requirement already satisfied: toolz in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from altair<6,>=4.0->streamlit>=0.63->streamlit-TTS) (0.12.1)\n",
|
859 |
+
"Requirement already satisfied: colorama in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from click<9,>=7.0->streamlit>=0.63->streamlit-TTS) (0.4.6)\n",
|
860 |
+
"Requirement already satisfied: gitdb<5,>=4.0.1 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from gitpython!=3.1.19,<4,>=3.0.7->streamlit>=0.63->streamlit-TTS) (4.0.11)\n",
|
861 |
+
"Requirement already satisfied: python-dateutil>=2.8.2 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from pandas<3,>=1.3.0->streamlit>=0.63->streamlit-TTS) (2.8.2)\n",
|
862 |
+
"Requirement already satisfied: pytz>=2020.1 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from pandas<3,>=1.3.0->streamlit>=0.63->streamlit-TTS) (2024.1)\n",
|
863 |
+
"Requirement already satisfied: tzdata>=2022.7 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from pandas<3,>=1.3.0->streamlit>=0.63->streamlit-TTS) (2023.3)\n",
|
864 |
+
"Requirement already satisfied: charset-normalizer<4,>=2 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from requests<3,>=2.27->streamlit>=0.63->streamlit-TTS) (3.3.2)\n",
|
865 |
+
"Requirement already satisfied: idna<4,>=2.5 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from requests<3,>=2.27->streamlit>=0.63->streamlit-TTS) (3.7)\n",
|
866 |
+
"Requirement already satisfied: urllib3<3,>=1.21.1 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from requests<3,>=2.27->streamlit>=0.63->streamlit-TTS) (2.1.0)\n",
|
867 |
+
"Requirement already satisfied: certifi>=2017.4.17 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from requests<3,>=2.27->streamlit>=0.63->streamlit-TTS) (2024.7.4)\n",
|
868 |
+
"Requirement already satisfied: markdown-it-py>=2.2.0 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from rich<14,>=10.14.0->streamlit>=0.63->streamlit-TTS) (3.0.0)\n",
|
869 |
+
"Requirement already satisfied: pygments<3.0.0,>=2.13.0 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from rich<14,>=10.14.0->streamlit>=0.63->streamlit-TTS) (2.15.1)\n",
|
870 |
+
"Requirement already satisfied: smmap<6,>=3.0.1 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from gitdb<5,>=4.0.1->gitpython!=3.1.19,<4,>=3.0.7->streamlit>=0.63->streamlit-TTS) (5.0.1)\n",
|
871 |
+
"Requirement already satisfied: MarkupSafe>=2.0 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from jinja2->altair<6,>=4.0->streamlit>=0.63->streamlit-TTS) (2.1.3)\n",
|
872 |
+
"Requirement already satisfied: mdurl~=0.1 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from markdown-it-py>=2.2.0->rich<14,>=10.14.0->streamlit>=0.63->streamlit-TTS) (0.1.2)\n",
|
873 |
+
"Requirement already satisfied: six>=1.5 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from python-dateutil>=2.8.2->pandas<3,>=1.3.0->streamlit>=0.63->streamlit-TTS) (1.16.0)\n",
|
874 |
+
"Requirement already satisfied: attrs>=22.2.0 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from jsonschema->altair<6,>=4.0->streamlit>=0.63->streamlit-TTS) (23.1.0)\n",
|
875 |
+
"Requirement already satisfied: jsonschema-specifications>=2023.03.6 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from jsonschema->altair<6,>=4.0->streamlit>=0.63->streamlit-TTS) (2023.7.1)\n",
|
876 |
+
"Requirement already satisfied: referencing>=0.28.4 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from jsonschema->altair<6,>=4.0->streamlit>=0.63->streamlit-TTS) (0.30.2)\n",
|
877 |
+
"Requirement already satisfied: rpds-py>=0.7.1 in c:\\users\\umesh\\anaconda3\\envs\\genai\\lib\\site-packages (from jsonschema->altair<6,>=4.0->streamlit>=0.63->streamlit-TTS) (0.10.6)\n",
|
878 |
+
"Using cached streamlit_TTS-0.0.7-py3-none-any.whl (446 kB)\n",
|
879 |
+
"Installing collected packages: streamlit-TTS\n",
|
880 |
+
"Successfully installed streamlit-TTS-0.0.7\n",
|
881 |
+
"Note: you may need to restart the kernel to use updated packages.\n"
|
882 |
+
]
|
883 |
+
},
|
884 |
+
{
|
885 |
+
"name": "stderr",
|
886 |
+
"output_type": "stream",
|
887 |
+
"text": [
|
888 |
+
"\n",
|
889 |
+
"[notice] A new release of pip is available: 24.2 -> 24.3.1\n",
|
890 |
+
"[notice] To update, run: python.exe -m pip install --upgrade pip\n"
|
891 |
+
]
|
892 |
+
}
|
893 |
+
],
|
894 |
+
"source": [
|
895 |
+
"pip install streamlit-TTS"
|
896 |
+
]
|
897 |
}
|
898 |
],
|
899 |
"metadata": {
|
900 |
"kernelspec": {
|
901 |
+
"display_name": "GenAI",
|
902 |
"language": "python",
|
903 |
"name": "python3"
|
904 |
},
|
|
|
912 |
"name": "python",
|
913 |
"nbconvert_exporter": "python",
|
914 |
"pygments_lexer": "ipython3",
|
915 |
+
"version": "3.11.9"
|
916 |
}
|
917 |
},
|
918 |
"nbformat": 4,
|
artifacts/response.txt
CHANGED
@@ -1,5 +1,3 @@
|
|
1 |
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
1. Self-isolate: To prevent the spread of illness, stay home and avoid contact with others as much as possible
|
|
|
1 |
|
2 |
|
3 |
+
I am a 25 year old woman from the Netherlands. I have been working as a software developer for 4 years now, and I am currently working at a company that specializes in developing software for the healthcare industry. In my free time, I enjoy playing video games, reading books, and spending time with my friends and family
|
|
|
|
logs/10_30_2024_09_04_15.log
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[2024-10-30 09:04:17,138] 28 root - INFO - LLM model for text generation created.
|
2 |
+
[2024-10-30 09:04:17,143] 29 root - INFO - LLM model for medical text generation created.
|
3 |
+
[2024-10-30 09:04:41,086] 23 root - INFO - Avatar system initiated.
|
4 |
+
[2024-10-30 09:05:52,355] 32 root - INFO - Text response generated.
|
5 |
+
[2024-10-30 09:08:21,255] 31 root - INFO - Text response generated.
|
6 |
+
[2024-10-30 09:08:24,885] 32 root - INFO - Text response generated.
|
7 |
+
[2024-10-30 09:08:26,885] 30 root - INFO - Sentiment of response generated.
|
8 |
+
[2024-10-30 09:08:26,895] 36 root - INFO - Response sentiment received.
|
9 |
+
[2024-10-30 09:08:51,950] 19 root - INFO - Response text convertion to audio done.
|
10 |
+
[2024-10-30 09:08:51,951] 40 root - INFO - Generated response saved as audio mp3 format.
|
11 |
+
[2024-10-30 09:08:51,965] 67 root - INFO - Generated response stored in response.txt file in artifacts folder.
|
12 |
+
[2024-10-30 09:08:51,967] 73 root - INFO - Stored text loaded.
|
13 |
+
[2024-10-30 09:09:16,677] 31 root - INFO - Text response generated.
|
14 |
+
[2024-10-30 09:09:20,003] 32 root - INFO - Text response generated.
|
15 |
+
[2024-10-30 09:09:20,246] 30 root - INFO - Sentiment of response generated.
|
16 |
+
[2024-10-30 09:09:20,247] 36 root - INFO - Response sentiment received.
|
17 |
+
[2024-10-30 09:09:35,241] 19 root - INFO - Response text convertion to audio done.
|
18 |
+
[2024-10-30 09:09:35,241] 40 root - INFO - Generated response saved as audio mp3 format.
|
19 |
+
[2024-10-30 09:09:35,242] 67 root - INFO - Generated response stored in response.txt file in artifacts folder.
|
20 |
+
[2024-10-30 09:09:35,242] 73 root - INFO - Stored text loaded.
|
21 |
+
[2024-10-30 09:13:32,259] 28 root - INFO - LLM model for text generation created.
|
22 |
+
[2024-10-30 09:13:32,259] 29 root - INFO - LLM model for medical text generation created.
|
23 |
+
[2024-10-30 09:13:38,739] 23 root - INFO - Avatar system initiated.
|
24 |
+
[2024-10-30 09:13:45,626] 31 root - INFO - Text response generated.
|
25 |
+
[2024-10-30 09:13:47,083] 32 root - INFO - Text response generated.
|
26 |
+
[2024-10-30 09:13:47,188] 30 root - INFO - Sentiment of response generated.
|
27 |
+
[2024-10-30 09:13:47,188] 36 root - INFO - Response sentiment received.
|
28 |
+
[2024-10-30 09:13:49,150] 19 root - INFO - Response text convertion to audio done.
|
29 |
+
[2024-10-30 09:13:49,150] 40 root - INFO - Generated response saved as audio mp3 format.
|
30 |
+
[2024-10-30 09:13:49,151] 67 root - INFO - Generated response stored in response.txt file in artifacts folder.
|
31 |
+
[2024-10-30 09:13:49,151] 73 root - INFO - Stored text loaded.
|
32 |
+
[2024-10-30 09:13:54,215] 31 root - INFO - Text response generated.
|
33 |
+
[2024-10-30 09:13:54,699] 32 root - INFO - Text response generated.
|
34 |
+
[2024-10-30 09:13:54,763] 30 root - INFO - Sentiment of response generated.
|
35 |
+
[2024-10-30 09:13:54,764] 36 root - INFO - Response sentiment received.
|
36 |
+
[2024-10-30 09:13:55,486] 19 root - INFO - Response text convertion to audio done.
|
37 |
+
[2024-10-30 09:13:55,487] 40 root - INFO - Generated response saved as audio mp3 format.
|
38 |
+
[2024-10-30 09:13:55,489] 67 root - INFO - Generated response stored in response.txt file in artifacts folder.
|
39 |
+
[2024-10-30 09:13:55,490] 73 root - INFO - Stored text loaded.
|
40 |
+
[2024-10-30 09:13:59,119] 31 root - INFO - Text response generated.
|
41 |
+
[2024-10-30 09:14:00,387] 32 root - INFO - Text response generated.
|
42 |
+
[2024-10-30 09:14:00,497] 30 root - INFO - Sentiment of response generated.
|
43 |
+
[2024-10-30 09:14:00,498] 36 root - INFO - Response sentiment received.
|
44 |
+
[2024-10-30 09:14:15,776] 19 root - INFO - Response text convertion to audio done.
|
45 |
+
[2024-10-30 09:14:15,777] 40 root - INFO - Generated response saved as audio mp3 format.
|
46 |
+
[2024-10-30 09:14:15,778] 67 root - INFO - Generated response stored in response.txt file in artifacts folder.
|
47 |
+
[2024-10-30 09:14:15,780] 73 root - INFO - Stored text loaded.
|
48 |
+
[2024-10-30 09:14:24,905] 19 root - INFO - Response text convertion to audio done.
|
49 |
+
[2024-10-30 09:14:25,047] 23 root - INFO - Generated audio file loaded
|
50 |
+
[2024-10-30 09:14:28,104] 32 root - INFO - Created audio file removed for entry of new file.
|
51 |
+
[2024-10-30 09:14:56,300] 31 root - INFO - Text response generated.
|
52 |
+
[2024-10-30 09:14:58,766] 32 root - INFO - Text response generated.
|
53 |
+
[2024-10-30 09:14:58,909] 30 root - INFO - Sentiment of response generated.
|
54 |
+
[2024-10-30 09:14:58,910] 36 root - INFO - Response sentiment received.
|
55 |
+
[2024-10-30 09:15:09,780] 19 root - INFO - Response text convertion to audio done.
|
56 |
+
[2024-10-30 09:15:09,781] 40 root - INFO - Generated response saved as audio mp3 format.
|
57 |
+
[2024-10-30 09:15:09,784] 67 root - INFO - Generated response stored in response.txt file in artifacts folder.
|
58 |
+
[2024-10-30 09:15:09,787] 73 root - INFO - Stored text loaded.
|
59 |
+
[2024-10-30 09:17:19,442] 31 root - INFO - Text response generated.
|
60 |
+
[2024-10-30 09:17:22,248] 32 root - INFO - Text response generated.
|
61 |
+
[2024-10-30 09:17:22,369] 30 root - INFO - Sentiment of response generated.
|
62 |
+
[2024-10-30 09:17:22,370] 36 root - INFO - Response sentiment received.
|
63 |
+
[2024-10-30 09:17:32,116] 19 root - INFO - Response text convertion to audio done.
|
64 |
+
[2024-10-30 09:17:32,116] 40 root - INFO - Generated response saved as audio mp3 format.
|
65 |
+
[2024-10-30 09:17:32,119] 67 root - INFO - Generated response stored in response.txt file in artifacts folder.
|
66 |
+
[2024-10-30 09:17:32,120] 73 root - INFO - Stored text loaded.
|
67 |
+
[2024-10-30 09:17:37,431] 19 root - INFO - Response text convertion to audio done.
|
68 |
+
[2024-10-30 09:17:37,432] 23 root - INFO - Generated audio file loaded
|
69 |
+
[2024-10-30 09:17:40,482] 32 root - INFO - Created audio file removed for entry of new file.
|
requirements.txt
CHANGED
@@ -13,3 +13,4 @@ SpeechRecognition
|
|
13 |
pyttsx3
|
14 |
streamlit
|
15 |
streamlit-option-menu
|
|
|
|
13 |
pyttsx3
|
14 |
streamlit
|
15 |
streamlit-option-menu
|
16 |
+
streamlit-TTS
|
src/components/__pycache__/docchat.cpython-311.pyc
CHANGED
Binary files a/src/components/__pycache__/docchat.cpython-311.pyc and b/src/components/__pycache__/docchat.cpython-311.pyc differ
|
|
src/components/__pycache__/textprocess.cpython-311.pyc
CHANGED
Binary files a/src/components/__pycache__/textprocess.cpython-311.pyc and b/src/components/__pycache__/textprocess.cpython-311.pyc differ
|
|
src/components/docchat.py
CHANGED
@@ -8,7 +8,8 @@ from langchain_huggingface import HuggingFaceEndpoint
|
|
8 |
|
9 |
# Text generation model
|
10 |
# repo_id="Laim/Llama-3.1-MedPalm2-imitate-8B-Instruct"
|
11 |
-
repo_id="Joycean0301/Llama-3.2-3B-Instruct-Medical-Conversational"
|
|
|
12 |
|
13 |
class DocChatProcessor:
|
14 |
def __init__(self, hf_token):
|
|
|
8 |
|
9 |
# Text generation model
|
10 |
# repo_id="Laim/Llama-3.1-MedPalm2-imitate-8B-Instruct"
|
11 |
+
# repo_id="Joycean0301/Llama-3.2-3B-Instruct-Medical-Conversational"
|
12 |
+
repo_id = "TheBloke/medalpaca-13B-GGML"
|
13 |
|
14 |
class DocChatProcessor:
|
15 |
def __init__(self, hf_token):
|
src/utils/__pycache__/accessory.cpython-311.pyc
CHANGED
Binary files a/src/utils/__pycache__/accessory.cpython-311.pyc and b/src/utils/__pycache__/accessory.cpython-311.pyc differ
|
|