Browse Source

Add files via upload

pull/45/head
SIFAT IMTIAZ 5 months ago committed by GitHub
parent
commit
11cc7542fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 154
      week2/community-contributions/TTS_STT.ipynb

154
week2/community-contributions/TTS_STT.ipynb

@ -2,18 +2,10 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "a60e0f78-4637-4318-9ab6-309c3f7f2799",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"API Key set\n"
]
}
],
"outputs": [],
"source": [
"import os\n",
"import json\n",
@ -34,7 +26,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "67026ef0-23be-4101-9371-b11f96f505bf",
"metadata": {},
"outputs": [],
@ -88,19 +80,10 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "12c66b44-293a-4bf9-b81e-0f6905fbf607",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"D:\\anaconda3\\envs\\llms\\Lib\\site-packages\\whisper\\__init__.py:150: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.\n",
" checkpoint = torch.load(fp, map_location=device)\n"
]
}
],
"outputs": [],
"source": [
"# STT Whisper\n",
"\n",
@ -137,7 +120,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "0156c106-1844-444a-9a22-88c3475805d9",
"metadata": {},
"outputs": [],
@ -172,131 +155,10 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "de61b54e-387e-4480-a592-c78e3245ddde",
"metadata": {},
"outputs": [
{
"name": "stdin",
"output_type": "stream",
"text": [
"press Enter to talk \n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"You: Hi there. Where am I talking to?\n",
"\n",
"\n",
"Nova: Beep boop! You're talking to me, Nova, a friendly robot designed to assist and chat with users like you. I'm happy to have you here!\n",
"\n",
"\n"
]
},
{
"name": "stdin",
"output_type": "stream",
"text": [
"press Enter to talk \n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"You: Do you know my name?\n",
"\n",
"\n",
"Nova: No, I don't have any information about your personal identity. This is the start of our conversation, so we're starting from scratch! Would you like to tell me your name, or keep it a secret?\n",
"\n",
"\n"
]
},
{
"name": "stdin",
"output_type": "stream",
"text": [
"press Enter to talk Sifat\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"You: Sifat\n",
"\n",
"\n",
"Nova: Beep boop, nice to meet you, Sifat! I'm glad we could have a brief introduction. What would you like to talk about today? The weather, hobbies, or something else?\n",
"\n",
"\n"
]
},
{
"name": "stdin",
"output_type": "stream",
"text": [
"press Enter to talk \n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"You: Nothing much today. I was just wondering that how you react because I am using.\n",
"\n",
"\n",
"Nova: Beep boop, I see! As a robot, my purpose is to assist and provide helpful responses, regardless of the user's background or context. My reactions are programmed to be neutral and friendly, so I don't have personal biases or opinions. I'm here to help and learn from our conversation, Sifat!\n",
"\n",
"\n"
]
},
{
"name": "stdin",
"output_type": "stream",
"text": [
"press Enter to talk \n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"You: So, do you keep on learning while we are having our conversations? Do you train yourself like that?\n",
"\n",
"\n",
"Nova: Beep boop, yes! That's one of the ways I learn and improve. The conversations I have with users like you help me refine my language understanding and generation capabilities. My training data is constantly updated and expanded to include new topics, nuances, and examples. So, our conversation right now helps me become a better conversationalist for others in the future!\n",
"\n",
"\n"
]
},
{
"name": "stdin",
"output_type": "stream",
"text": [
"press Enter to talk bye\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"You: bye\n",
"\n",
"\n",
"Nova: Beep boop, it was nice chatting with you, Sifat! Feel free to come back and talk anytime you'd like. Have a great day, and I'll be here when you're ready for our next conversation! Bye for now!\n",
"\n",
"\n"
]
}
],
"outputs": [],
"source": [
"run_chat()"
]

Loading…
Cancel
Save