From db1ae52b5739f95e251de7f444f183810a77dfde Mon Sep 17 00:00:00 2001 From: Kei Oshima Date: Wed, 29 Nov 2023 20:43:02 -0500 Subject: [PATCH 1/8] trying to fix yaml --- .github/workflows/lint.yml | 4 + Pipfile | 1 + Pipfile.lock | 189 +++++++++++++++++++------------------ 3 files changed, 100 insertions(+), 94 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 17a2c83..0513c14 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,6 +14,10 @@ jobs: run: | sudo apt-get update sudo apt-get install -y portaudio19-dev +<<<<<<< HEAD +======= + - name: Install dependencies +>>>>>>> 7f47eac (tring to get workflow) if: ${{ hashFiles('**/*.py') != '' }} run: | python -m pip install --upgrade pip diff --git a/Pipfile b/Pipfile index 9149750..b88ecb3 100644 --- a/Pipfile +++ b/Pipfile @@ -12,6 +12,7 @@ pymongo = "*" speechrecognition = "*" pyaudio = "*" setuptools = "*" +tomli = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index a2f41c3..81de0d7 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "fe9749392ffbf23d96ff5f0d213c4e34ab8429245e8e26b0ee47d5e69d36d261" + "sha256": "e4f16b395a1d122a2290256dc189627e804dfbfb0f5505d288c1d580701fb4d6" }, "pipfile-spec": 6, "requires": { @@ -169,14 +169,6 @@ "markers": "python_version >= '3.7'", "version": "==8.1.7" }, - "colorama": { - "hashes": [ - "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", - "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6" - ], - "markers": "sys_platform == 'win32'", - "version": "==0.4.6" - }, "dill": { "hashes": [ "sha256:76b122c08ef4ce2eedcd4d1abd8e641114bfc6c2867f49f3c41facf65bf19f5e", @@ -204,11 +196,11 @@ }, "idna": { "hashes": [ - "sha256:27009fe2735bf8723353582d48575b23c533cc2c2de7b5a68908d91b5eb18d08", - "sha256:79b8f0ac92d2351be5f6122356c9a592c96d81c9a79e4b488bf2a6a15f88057a" + "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca", + "sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f" ], "markers": "python_version >= '3.5'", - "version": "==3.5" + "version": "==3.6" }, "iniconfig": { "hashes": [ @@ -384,91 +376,91 @@ }, "pymongo": { "hashes": [ - "sha256:014e7049dd019a6663747ca7dae328943e14f7261f7c1381045dfc26a04fa330", - "sha256:055f5c266e2767a88bb585d01137d9c7f778b0195d3dbf4a487ef0638be9b651", - "sha256:05c30fd35cc97f14f354916b45feea535d59060ef867446b5c3c7f9b609dd5dc", - "sha256:0634994b026336195778e5693583c060418d4ab453eff21530422690a97e1ee8", - "sha256:09c7de516b08c57647176b9fc21d929d628e35bcebc7422220c89ae40b62126a", - "sha256:107a234dc55affc5802acb3b6d83cbb8c87355b38a9457fcd8806bdeb8bce161", - "sha256:10a379fb60f1b2406ae57b8899bacfe20567918c8e9d2d545e1b93628fcf2050", - "sha256:128b1485753106c54af481789cdfea12b90a228afca0b11fb3828309a907e10e", - "sha256:1394c4737b325166a65ae7c145af1ebdb9fb153ebedd37cf91d676313e4a67b8", - "sha256:1c63e3a2e8fb815c4b1f738c284a4579897e37c3cfd95fdb199229a1ccfb638a", - "sha256:1e4ed21029d80c4f62605ab16398fe1ce093fff4b5f22d114055e7d9fbc4adb0", - "sha256:1ec71ac633b126c0775ed4604ca8f56c3540f5c21a1220639f299e7a544b55f9", - "sha256:21812453354b151200034750cd30b0140e82ec2a01fd4357390f67714a1bfbde", - "sha256:256c503a75bd71cf7fb9ebf889e7e222d49c6036a48aad5a619f98a0adf0e0d7", - "sha256:2703a9f8f5767986b4f51c259ff452cc837c5a83c8ed5f5361f6e49933743b2f", - "sha256:288c21ab9531b037f7efa4e467b33176bc73a0c27223c141b822ab4a0e66ff2a", - "sha256:2972dd1f1285866aba027eff2f4a2bbf8aa98563c2ced14cb34ee5602b36afdf", - "sha256:2973f113e079fb98515722cd728e1820282721ec9fd52830e4b73cabdbf1eb28", - "sha256:2ca0ba501898b2ec31e6c3acf90c31910944f01d454ad8e489213a156ccf1bda", - "sha256:2d2be5c9c3488fa8a70f83ed925940f488eac2837a996708d98a0e54a861f212", - "sha256:2f8c04277d879146eacda920476e93d520eff8bec6c022ac108cfa6280d84348", - "sha256:325701ae7b56daa5b0692305b7cb505ca50f80a1288abb32ff420a8a209b01ca", - "sha256:3729b8db02063da50eeb3db88a27670d85953afb9a7f14c213ac9e3dca93034b", - "sha256:3919708594b86d0f5cdc713eb6fccd3f9b9532af09ea7a5d843c933825ef56c4", - "sha256:39a1cd5d383b37285641d5a7a86be85274466ae336a61b51117155936529f9b3", - "sha256:3ec6c20385c5a58e16b1ea60c5e4993ea060540671d7d12664f385f2fb32fe79", - "sha256:47aa128be2e66abd9d1a9b0437c62499d812d291f17b55185cb4aa33a5f710a4", - "sha256:49f2af6cf82509b15093ce3569229e0d53c90ad8ae2eef940652d4cf1f81e045", - "sha256:4a0269811661ba93c472c8a60ea82640e838c2eb148d252720a09b5123f2c2fe", - "sha256:518c90bdd6e842c446d01a766b9136fec5ec6cc94f3b8c3f8b4a332786ee6b64", - "sha256:5717a308a703dda2886a5796a07489c698b442f5e409cf7dc2ac93de8d61d764", - "sha256:5802acc012bbb4bce4dff92973dff76482f30ef35dd4cb8ab5b0e06aa8f08c80", - "sha256:5e63146dbdb1eac207464f6e0cfcdb640c9c5ff0f57b754fa96fe252314a1dc6", - "sha256:6695d7136a435c1305b261a9ddb9b3ecec9863e05aab3935b96038145fd3a977", - "sha256:680fa0fc719e1a3dcb81130858368f51d83667d431924d0bcf249644bce8f303", - "sha256:6b18276f14b4b6d92e707ab6db19b938e112bd2f1dc3f9f1a628df58e4fd3f0d", - "sha256:6bafea6061d63059d8bc2ffc545e2f049221c8a4457d236c5cd6a66678673eab", - "sha256:6d6a1b1361f118e7fefa17ae3114e77f10ee1b228b20d50c47c9f351346180c8", - "sha256:747c84f4e690fbe6999c90ac97246c95d31460d890510e4a3fa61b7d2b87aa34", - "sha256:79f41576b3022c2fe9780ae3e44202b2438128a25284a8ddfa038f0785d87019", - "sha256:7b0e6361754ac596cd16bfc6ed49f69ffcd9b60b7bc4bcd3ea65c6a83475e4ff", - "sha256:7e3b0127b260d4abae7b62203c4c7ef0874c901b55155692353db19de4b18bc4", - "sha256:7fc2bb8a74dcfcdd32f89528e38dcbf70a3a6594963d60dc9595e3b35b66e414", - "sha256:806e094e9e85d8badc978af8c95b69c556077f11844655cb8cd2d1758769e521", - "sha256:81dd1308bd5630d2bb5980f00aa163b986b133f1e9ed66c66ce2a5bc3572e891", - "sha256:82e620842e12e8cb4050d2643a81c8149361cd82c0a920fa5a15dc4ca8a4000f", - "sha256:85f2cdc400ee87f5952ebf2a117488f2525a3fb2e23863a8efe3e4ee9e54e4d1", - "sha256:8ab6bcc8e424e07c1d4ba6df96f7fb963bcb48f590b9456de9ebd03b88084fe8", - "sha256:8adf014f2779992eba3b513e060d06f075f0ab2fb3ad956f413a102312f65cdf", - "sha256:9b0f98481ad5dc4cb430a60bbb8869f05505283b9ae1c62bdb65eb5e020ee8e3", - "sha256:9bea9138b0fc6e2218147e9c6ce1ff76ff8e29dc00bb1b64842bd1ca107aee9f", - "sha256:a09bfb51953930e7e838972ddf646c5d5f984992a66d79da6ba7f6a8d8a890cd", - "sha256:a0be99b599da95b7a90a918dd927b20c434bea5e1c9b3efc6a3c6cd67c23f813", - "sha256:a49aca4d961823b2846b739380c847e8964ff7ae0f0a683992b9d926054f0d6d", - "sha256:a4dc1319d0c162919ee7f4ee6face076becae2abbd351cc14f1fe70af5fb20d9", - "sha256:a8273e1abbcff1d7d29cbbb1ea7e57d38be72f1af3c597c854168508b91516c2", - "sha256:a8f7f9feecae53fa18d6a3ea7c75f9e9a1d4d20e5c3f9ce3fba83f07bcc4eee2", - "sha256:ad4f66fbb893b55f96f03020e67dcab49ffde0177c6565ccf9dec4fdf974eb61", - "sha256:af425f323fce1b07755edd783581e7283557296946212f5b1a934441718e7528", - "sha256:b14dd73f595199f4275bed4fb509277470d9b9059310537e3b3daba12b30c157", - "sha256:b4ad70d7cac4ca0c7b31444a0148bd3af01a2662fa12b1ad6f57cd4a04e21766", - "sha256:b80a4ee19b3442c57c38afa978adca546521a8822d663310b63ae2a7d7b13f3a", - "sha256:ba51129fcc510824b6ca6e2ce1c27e3e4d048b6e35d3ae6f7e517bed1b8b25ce", - "sha256:c011bd5ad03cc096f99ffcfdd18a1817354132c1331bed7a837a25226659845f", - "sha256:cc94f9fea17a5af8cf1a343597711a26b0117c0b812550d99934acb89d526ed2", - "sha256:ccd785fafa1c931deff6a7116e9a0d402d59fabe51644b0d0c268295ff847b25", - "sha256:d16a534da0e39785687b7295e2fcf9a339f4a20689024983d11afaa4657f8507", - "sha256:d3077a31633beef77d057c6523f5de7271ddef7bde5e019285b00c0cc9cac1e3", - "sha256:d603edea1ff7408638b2504905c032193b7dcee7af269802dbb35bc8c3310ed5", - "sha256:db082f728160369d9a6ed2e722438291558fc15ce06d0a7d696a8dad735c236b", - "sha256:ddef295aaf80cefb0c1606f1995899efcb17edc6b327eb6589e234e614b87756", - "sha256:e16ade71c93f6814d095d25cd6d28a90d63511ea396bd96e9ffcb886b278baaa", - "sha256:e3db7d833a7c38c317dc95b54e27f1d27012e031b45a7c24e360b53197d5f6e7", - "sha256:e5e193f89f4f8c1fe273f9a6e6df915092c9f2af6db2d1afb8bd53855025c11f", - "sha256:eb438a8bf6b695bf50d57e6a059ff09652a07968b2041178b3744ea785fcef9b", - "sha256:ebf02c32afa6b67e5861a27183dd98ed88419a94a2ab843cc145fb0bafcc5b28", - "sha256:ecd9e1fa97aa11bf67472220285775fa15e896da108f425e55d23d7540a712ce", - "sha256:ef67fedd863ffffd4adfd46d9d992b0f929c7f61a8307366d664d93517f2c78e", - "sha256:f28ae33dc5a0b9cee06e95fd420e42155d83271ab75964baf747ce959cac5f52", - "sha256:fb1c56d891f9e34303c451998ef62ba52659648bb0d75b03c5e4ac223a3342c2", - "sha256:fe03bf25fae4b95d8afe40004a321df644400fdcba4c8e5e1a19c1085b740888" + "sha256:00c199e1c593e2c8b033136d7a08f0c376452bac8a896c923fcd6f419e07bdd2", + "sha256:010bc9aa90fd06e5cc52c8fac2c2fd4ef1b5f990d9638548dde178005770a5e8", + "sha256:026a24a36394dc8930cbcb1d19d5eb35205ef3c838a7e619e04bd170713972e7", + "sha256:061598cbc6abe2f382ab64c9caa83faa2f4c51256f732cdd890bcc6e63bfb67e", + "sha256:13552ca505366df74e3e2f0a4f27c363928f3dff0eef9f281eb81af7f29bc3c5", + "sha256:13d613c866f9f07d51180f9a7da54ef491d130f169e999c27e7633abe8619ec9", + "sha256:144a31391a39a390efce0c5ebcaf4bf112114af4384c90163f402cec5ede476b", + "sha256:1461199b07903fc1424709efafe379205bf5f738144b1a50a08b0396357b5abf", + "sha256:154b361dcb358ad377d5d40df41ee35f1cc14c8691b50511547c12404f89b5cb", + "sha256:1c5654bb8bb2bdb10e7a0bc3c193dd8b49a960b9eebc4381ff5a2043f4c3c441", + "sha256:1de3c6faf948f3edd4e738abdb4b76572b4f4fdfc1fed4dad02427e70c5a6219", + "sha256:1ed23b0e2dac6f84f44c8494fbceefe6eb5c35db5c1099f56ab78fc0d94ab3af", + "sha256:1f2b856518bfcfa316c8dae3d7b412aecacf2e8ba30b149f5eb3b63128d703b9", + "sha256:2346450a075625c4d6166b40a013b605a38b6b6168ce2232b192a37fb200d588", + "sha256:262356ea5fcb13d35fb2ab6009d3927bafb9504ef02339338634fffd8a9f1ae4", + "sha256:27b81ecf18031998ad7db53b960d1347f8f29e8b7cb5ea7b4394726468e4295e", + "sha256:2940aa20e9cc328e8ddeacea8b9a6f5ddafe0b087fedad928912e787c65b4909", + "sha256:2d4ccac3053b84a09251da8f5350bb684cbbf8c8c01eda6b5418417d0a8ab198", + "sha256:2dd2f6960ee3c9360bed7fb3c678be0ca2d00f877068556785ec2eb6b73d2414", + "sha256:3071ec998cc3d7b4944377e5f1217c2c44b811fae16f9a495c7a1ce9b42fb038", + "sha256:3094c7d2f820eecabadae76bfec02669567bbdd1730eabce10a5764778564f7b", + "sha256:30b2c9caf3e55c2e323565d1f3b7e7881ab87db16997dc0cbca7c52885ed2347", + "sha256:3177f783ae7e08aaf7b2802e0df4e4b13903520e8380915e6337cdc7a6ff01d8", + "sha256:31dab1f3e1d0cdd57e8df01b645f52d43cc1b653ed3afd535d2891f4fc4f9712", + "sha256:33bb16a07d3cc4e0aea37b242097cd5f7a156312012455c2fa8ca396953b11c4", + "sha256:349093675a2d3759e4fb42b596afffa2b2518c890492563d7905fac503b20daa", + "sha256:39d77d8bbb392fa443831e6d4ae534237b1f4eee6aa186f0cdb4e334ba89536e", + "sha256:3a7f02a58a0c2912734105e05dedbee4f7507e6f1bd132ebad520be0b11d46fd", + "sha256:3b287e814a01deddb59b88549c1e0c87cefacd798d4afc0c8bd6042d1c3d48aa", + "sha256:3c74f4725485f0a7a3862cfd374cc1b740cebe4c133e0c1425984bcdcce0f4bb", + "sha256:3cadf7f4c8e94d8a77874b54a63c80af01f4d48c4b669c8b6867f86a07ba994f", + "sha256:3d18a9b9b858ee140c15c5bfcb3e66e47e2a70a03272c2e72adda2482f76a6ad", + "sha256:3f0e6a6c807fa887a0c51cc24fe7ea51bb9e496fe88f00d7930063372c3664c3", + "sha256:4344c30025210b9fa80ec257b0e0aab5aa1d5cca91daa70d82ab97b482cc038e", + "sha256:4497d49d785482cc1a44a0ddf8830b036a468c088e72a05217f5b60a9e025012", + "sha256:547dc5d7f834b1deefda51aedb11a7af9c51c45e689e44e14aa85d44147c7657", + "sha256:5556e306713e2522e460287615d26c0af0fe5ed9d4f431dad35c6624c5d277e9", + "sha256:55dac73316e7e8c2616ba2e6f62b750918e9e0ae0b2053699d66ca27a7790105", + "sha256:56816e43c92c2fa8c11dc2a686f0ca248bea7902f4a067fa6cbc77853b0f041e", + "sha256:5bd94c503271e79917b27c6e77f7c5474da6930b3fb9e70a12e68c2dff386b9a", + "sha256:5ec31adc2e988fd7db3ab509954791bbc5a452a03c85e45b804b4bfc31fa221d", + "sha256:69247f7a2835fc0984bbf0892e6022e9a36aec70e187fcfe6cae6a373eb8c4de", + "sha256:6a0ae7a48a6ef82ceb98a366948874834b86c84e288dbd55600c1abfc3ac1d88", + "sha256:6a1810c2cbde714decf40f811d1edc0dae45506eb37298fd9d4247b8801509fe", + "sha256:76013fef1c9cd1cd00d55efde516c154aa169f2bf059b197c263a255ba8a9ddf", + "sha256:77e0df59b1a4994ad30c6d746992ae887f9756a43fc25dec2db515d94cf0222d", + "sha256:7bb0e9049e81def6829d09558ad12d16d0454c26cabe6efc3658e544460688d9", + "sha256:88beb444fb438385e53dc9110852910ec2a22f0eab7dd489e827038fdc19ed8d", + "sha256:8b47ebd89e69fbf33d1c2df79759d7162fc80c7652dacfec136dae1c9b3afac7", + "sha256:8d219b4508f71d762368caec1fc180960569766049bbc4d38174f05e8ef2fe5b", + "sha256:8ec75f35f62571a43e31e7bd11749d974c1b5cd5ea4a8388725d579263c0fdf6", + "sha256:9167e735379ec43d8eafa3fd675bfbb12e2c0464f98960586e9447d2cf2c7a83", + "sha256:9a710c184ba845afb05a6f876edac8f27783ba70e52d5eaf939f121fc13b2f59", + "sha256:9aafd036f6f2e5ad109aec92f8dbfcbe76cff16bad683eb6dd18013739c0b3ae", + "sha256:9c79d597fb3a7c93d7c26924db7497eba06d58f88f58e586aa69b2ad89fee0f8", + "sha256:a2831e05ce0a4df10c4ac5399ef50b9a621f90894c2a4d2945dc5658765514ed", + "sha256:a5e641f931c5cd95b376fd3c59db52770e17bec2bf86ef16cc83b3906c054845", + "sha256:b10d8cda9fc2fcdcfa4a000aa10413a2bf8b575852cd07cb8a595ed09689ca98", + "sha256:b435b13bb8e36be11b75f7384a34eefe487fe87a6267172964628e2b14ecf0a7", + "sha256:b7b1a83ce514700276a46af3d9e481ec381f05b64939effc9065afe18456a6b9", + "sha256:b8729dbf25eb32ad0dc0b9bd5e6a0d0b7e5c2dc8ec06ad171088e1896b522a74", + "sha256:bbed8cccebe1169d45cedf00461b2842652d476d2897fd1c42cf41b635d88746", + "sha256:c258dbacfff1224f13576147df16ce3c02024a0d792fd0323ac01bed5d3c545d", + "sha256:c30a9e06041fbd7a7590693ec5e407aa8737ad91912a1e70176aff92e5c99d20", + "sha256:c91ea3915425bd4111cb1b74511cdc56d1d16a683a48bf2a5a96b6a6c0f297f7", + "sha256:d0355cff58a4ed6d5e5f6b9c3693f52de0784aa0c17119394e2a8e376ce489d4", + "sha256:d483793a384c550c2d12cb794ede294d303b42beff75f3b3081f57196660edaf", + "sha256:d4c2be9760b112b1caf649b4977b81b69893d75aa86caf4f0f398447be871f3c", + "sha256:d8e62d06e90f60ea2a3d463ae51401475568b995bafaffd81767d208d84d7bb1", + "sha256:da08ea09eefa6b960c2dd9a68ec47949235485c623621eb1d6c02b46765322ac", + "sha256:dd1fa413f8b9ba30140de198e4f408ffbba6396864c7554e0867aa7363eb58b2", + "sha256:e2aced6fb2f5261b47d267cb40060b73b6527e64afe54f6497844c9affed5fd0", + "sha256:e438417ce1dc5b758742e12661d800482200b042d03512a8f31f6aaa9137ad40", + "sha256:e470fa4bace5f50076c32f4b3cc182b31303b4fefb9b87f990144515d572820b", + "sha256:eaf2f65190c506def2581219572b9c70b8250615dc918b3b7c218361a51ec42e", + "sha256:ef102a67ede70e1721fe27f75073b5314911dbb9bc27cde0a1c402a11531e7bd", + "sha256:ef801027629c5b511cf2ba13b9be29bfee36ae834b2d95d9877818479cdc99ea", + "sha256:f7acc03a4f1154ba2643edeb13658d08598fe6e490c3dd96a241b94f09801626", + "sha256:f9756f1d25454ba6a3c2f1ef8b7ddec23e5cdeae3dc3c3377243ae37a383db00", + "sha256:ff62ba8ff70f01ab4fe0ae36b2cb0b5d1f42e73dfc81ddf0758cd9f77331ad25", + "sha256:ff925f1cca42e933376d09ddc254598f8c5fcd36efc5cac0118bb36c36217c41" ], "index": "pypi", "markers": "python_version >= '3.7'", - "version": "==4.6.0" + "version": "==4.6.1" }, "pytest": { "hashes": [ @@ -505,6 +497,15 @@ "markers": "python_version >= '3.8'", "version": "==3.10.0" }, + "tomli": { + "hashes": [ + "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", + "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==2.0.1" + }, "tomlkit": { "hashes": [ "sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4", From 71b90909ea9176b73ff303baf46a916b163ea0be Mon Sep 17 00:00:00 2001 From: Kei Oshima Date: Wed, 29 Nov 2023 20:44:27 -0500 Subject: [PATCH 2/8] trying to see other installation needed --- .github/workflows/lint.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0513c14..e9e3d62 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,10 +14,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y portaudio19-dev -<<<<<<< HEAD -======= - name: Install dependencies ->>>>>>> 7f47eac (tring to get workflow) if: ${{ hashFiles('**/*.py') != '' }} run: | python -m pip install --upgrade pip From b38b69dab795b48e4028513ba3bf7ef030d9ca92 Mon Sep 17 00:00:00 2001 From: Kei Oshima Date: Wed, 29 Nov 2023 21:12:38 -0500 Subject: [PATCH 3/8] editing yaml file --- .../machine_learning_client.py | 75 +------------------ web-app/app.py | 37 +++++---- 2 files changed, 26 insertions(+), 86 deletions(-) diff --git a/machine-learning-client/machine_learning_client.py b/machine-learning-client/machine_learning_client.py index c2a034a..ab54d5d 100644 --- a/machine-learning-client/machine_learning_client.py +++ b/machine-learning-client/machine_learning_client.py @@ -5,10 +5,11 @@ from enum import Enum import pyaudio import speech_recognition as sr -<<<<<<< HEAD + class ML: - """Machine Learning class functions """ + """Machine Learning class functions""" + pa = pyaudio.PyAudio() def list_all_mic(self): @@ -56,66 +57,7 @@ def audio_to_text(self, audio_file_string): class BuzzWord(Enum): """List of Buzzwords""" - HELLO = "hello" - UGH = "ugh" - - def grade_response(self, transcription): - """ - Give out a score based on the transcribed audio - -======= - - -class ML: - """Machine Learning class functions """ - pa = pyaudio.PyAudio() - - def list_all_mic(self): - """ - List all available microphone device - """ - if len(sr.Microphone.list_microphone_names()) == 0: - print("no device available") - return - - for index, name in enumerate(sr.Microphone.list_microphone_names()): - print(f'Microphone with name "{name}"') - print(f" found for `Microphone(device_index={index})`") - - def record_microphone(self): - """Function for recording microphone input""" - ML.list_all_mic(self) # Use for debug - mc = None - try: - mc = sr.Microphone() - print("Mic init successful") - except OSError: - mc = sr.Microphone(0) - print("no default mic") - with mc as source: - print("Please give your answer:") - r = sr.Recognizer() - audio = r.listen(source) - return audio - - def audio_to_text(self, audio_file_string): - """Function for converting audio file to text transcription""" - r = sr.Recognizer() - with sr.AudioFile(audio_file_string) as source: - ad = r.listen(source) - try: - transcription = r.recognize_google(ad) - print(transcription) - print(type(transcription)) - except sr.UnknownValueError: - print("Sorry, we could not recognize your response.") - except sr.RequestError: - print("Sorry, there appears to be an error with Google Speech to Text") - return transcription - - class BuzzWord(Enum): - """List of Buzzwords""" HELLO = "hello" UGH = "ugh" @@ -124,7 +66,6 @@ def grade_response(self, transcription): Give out a score based on the transcribed audio ->>>>>>> 5a0af371e4dbfe2fdc0328cf9e5f1e13a84def20 Args: transcription (str): transcribed audio """ @@ -140,19 +81,11 @@ def main(): """Main Method""" print("Tell me a little bit about yourself") ml = ML() -<<<<<<< HEAD - audio = r'..\\web-app\uploads\user_audio.wav' + audio = r"..\\web-app\uploads\user_audio.wav" transcription = ml.audio_to_text(audio) result = ml.grade_response(transcription) print(result) print("test main") - -======= - audio = ml.record_microphone() - transcription = ml.audio_to_text(audio) - result = ml.grade_response(transcription) - print(result) ->>>>>>> 5a0af371e4dbfe2fdc0328cf9e5f1e13a84def20 if __name__ == "__main__": diff --git a/web-app/app.py b/web-app/app.py index bc67e37..172e821 100644 --- a/web-app/app.py +++ b/web-app/app.py @@ -2,29 +2,37 @@ import os import subprocess -app = Flask('project4') +app = Flask("project4") -app.config['UPLOAD_FOLDER'] = 'uploads' -os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True) +app.config["UPLOAD_FOLDER"] = "uploads" +os.makedirs(app.config["UPLOAD_FOLDER"], exist_ok=True) -@app.route('/') + +@app.route("/") def RootPage(): - return render_template('root.html') + return render_template("root.html") + -@app.route('/analyzeData', methods=['POST']) +@app.route("/analyzeData", methods=["POST"]) def analyzeData(): try: - if 'audio' not in request.files: + if "audio" not in request.files: return jsonify({"status": "error", "message": "No audio file provided"}) - audio_file = request.files['audio'] - audio_path = os.path.join(app.config['UPLOAD_FOLDER'], 'user_audio.wav') + audio_file = request.files["audio"] + audio_path = os.path.join(app.config["UPLOAD_FOLDER"], "user_audio.wav") audio_file.save(audio_path) - - print("Audio file saved at:", audio_path) - result = subprocess.run(["C:\\Users\\Andrew - User\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe", "E:\\4-containerized-app-exercise-rizzballs\\machine-learning-client\\machine_learning_client.py", audio_path], capture_output=True, text=True) - + print("Audio file saved at:", audio_path) + result = subprocess.run( + [ + "C:\\Users\\Andrew - User\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe", + "E:\\4-containerized-app-exercise-rizzballs\\machine-learning-client\\machine_learning_client.py", + audio_path, + ], + capture_output=True, + text=True, + ) return jsonify({"status": "success"}) @@ -33,6 +41,5 @@ def analyzeData(): if __name__ == "__main__": - PORT = os.getenv('PORT', 5000) + PORT = os.getenv("PORT", 5000) app.run(debug=True, port=PORT) - From 4d293905cd10be82f421f508db1da22361bbb37b Mon Sep 17 00:00:00 2001 From: Kei Oshima Date: Wed, 29 Nov 2023 21:28:35 -0500 Subject: [PATCH 4/8] attempt two to fix workflow --- Pipfile | 1 + Pipfile.lock | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index b88ecb3..f4f6596 100644 --- a/Pipfile +++ b/Pipfile @@ -13,6 +13,7 @@ speechrecognition = "*" pyaudio = "*" setuptools = "*" tomli = "*" +typing-extensions = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 81de0d7..04b8101 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "e4f16b395a1d122a2290256dc189627e804dfbfb0f5505d288c1d580701fb4d6" + "sha256": "d2b895e3132463b7502332d5cb3ad900441d4c4a8c81d8661baa50e020013e7d" }, "pipfile-spec": 6, "requires": { @@ -514,6 +514,15 @@ "markers": "python_version >= '3.7'", "version": "==0.12.3" }, + "typing-extensions": { + "hashes": [ + "sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0", + "sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef" + ], + "index": "pypi", + "markers": "python_version >= '3.8'", + "version": "==4.8.0" + }, "urllib3": { "hashes": [ "sha256:55901e917a5896a349ff771be919f8bd99aff50b79fe58fec595eb37bbc56bb3", From c0864115ade2d2f28144f00f38804b62fc20b5b4 Mon Sep 17 00:00:00 2001 From: Kei Oshima Date: Wed, 29 Nov 2023 21:33:30 -0500 Subject: [PATCH 5/8] third attemp to fix workflow --- Pipfile | 1 + Pipfile.lock | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index f4f6596..203949d 100644 --- a/Pipfile +++ b/Pipfile @@ -14,6 +14,7 @@ pyaudio = "*" setuptools = "*" tomli = "*" typing-extensions = "*" +dill = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 04b8101..4d87ccb 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "d2b895e3132463b7502332d5cb3ad900441d4c4a8c81d8661baa50e020013e7d" + "sha256": "18a3851420f7ccd24c4c2aa94698a999936c11b8ab3b0e1ea835d7658c066ac9" }, "pipfile-spec": 6, "requires": { @@ -174,7 +174,8 @@ "sha256:76b122c08ef4ce2eedcd4d1abd8e641114bfc6c2867f49f3c41facf65bf19f5e", "sha256:cc1c8b182eb3013e24bd475ff2e9295af86c1a38eb1aff128dac8962a9ce3c03" ], - "markers": "python_version >= '3.11'", + "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==0.3.7" }, "dnspython": { From b274290a2e9d0731f3bb1c768d84431d63da832d Mon Sep 17 00:00:00 2001 From: Kei Oshima Date: Wed, 29 Nov 2023 22:13:14 -0500 Subject: [PATCH 6/8] fixing linting issues --- web-app/app.py | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/web-app/app.py b/web-app/app.py index 172e821..f79a502 100644 --- a/web-app/app.py +++ b/web-app/app.py @@ -1,6 +1,12 @@ -from flask import Flask, render_template, request, jsonify + +""" +app.py file that helps serve as the front end of our application +""" + import os import subprocess +from flask import Flask, render_template, request, jsonify + app = Flask("project4") @@ -9,12 +15,18 @@ @app.route("/") -def RootPage(): +def root_page(): + """ + template to render root page + """ return render_template("root.html") @app.route("/analyzeData", methods=["POST"]) -def analyzeData(): +def analyze_data(): + """ + Function to send genreated audio file to the machine learning client + """ try: if "audio" not in request.files: return jsonify({"status": "error", "message": "No audio file provided"}) @@ -27,19 +39,29 @@ def analyzeData(): result = subprocess.run( [ "C:\\Users\\Andrew - User\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe", - "E:\\4-containerized-app-exercise-rizzballs\\machine-learning-client\\machine_learning_client.py", - audio_path, + "E:\\4-containerized-app-exercise-rizzballs\\machine-learning-client\\machine_learning_client.py", # pylint: disable=line-too-long + audio_path, # pylint: disable=line-too-long disable=trailing-whitespace ], capture_output=True, text=True, - ) + check=True + ) + if result.returncode == 0: + print("Process succeeded!") + else: + print("Process failed. Exit code:", result.returncode) return jsonify({"status": "success"}) - except Exception as e: - return jsonify({"status": "error", "message": str(e)}) + except FileNotFoundError as e: + return jsonify({"status": "error", "message": f"File not found: {str(e)}"}) + + except subprocess.CalledProcessError as e: + return jsonify({"status": "error", "message": f"Subprocess failed: {str(e)}"}) + + if __name__ == "__main__": - PORT = os.getenv("PORT", 5000) + PORT = os.getenv("PORT", "5000") app.run(debug=True, port=PORT) From d82c8ef22738988e5c99467ac760da5ce5a2fa5c Mon Sep 17 00:00:00 2001 From: Kei Oshima Date: Wed, 29 Nov 2023 22:23:14 -0500 Subject: [PATCH 7/8] fixing more pylint issues --- Pipfile | 1 + Pipfile.lock | 11 ++++++++++- database/{database.py.py => database.py} | 6 ++++-- 3 files changed, 15 insertions(+), 3 deletions(-) rename database/{database.py.py => database.py} (90%) diff --git a/Pipfile b/Pipfile index 203949d..a85242e 100644 --- a/Pipfile +++ b/Pipfile @@ -15,6 +15,7 @@ setuptools = "*" tomli = "*" typing-extensions = "*" dill = "*" +python-dotenv = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 4d87ccb..c086eca 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "18a3851420f7ccd24c4c2aa94698a999936c11b8ab3b0e1ea835d7658c066ac9" + "sha256": "1a80dee348b2df596b7981af4d71a317ad60b0bdcbd9749bf36b456bf2a899c4" }, "pipfile-spec": 6, "requires": { @@ -472,6 +472,15 @@ "markers": "python_version >= '3.7'", "version": "==7.4.3" }, + "python-dotenv": { + "hashes": [ + "sha256:a8df96034aae6d2d50a4ebe8216326c61c3eb64836776504fcca410e5937a3ba", + "sha256:f5971a9226b701070a4bf2c38c89e5a3f0d64de8debda981d1db98583009122a" + ], + "index": "pypi", + "markers": "python_version >= '3.8'", + "version": "==1.0.0" + }, "requests": { "hashes": [ "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f", diff --git a/database/database.py.py b/database/database.py similarity index 90% rename from database/database.py.py rename to database/database.py index a8a15aa..c941666 100644 --- a/database/database.py.py +++ b/database/database.py @@ -1,5 +1,7 @@ +""" +database file to connect ot database +""" import os - from pymongo import MongoClient from dotenv import load_dotenv @@ -18,4 +20,4 @@ DB = client[os.getenv("MONGODB_DATABASE")] print("Pinged your deployment. You successfully connected to MongoDB!") except Exception as e: # pylint: disable=broad-except - print(e) \ No newline at end of file + print(e) From 82e7fecfc2866016bb34b6185dce0c42d46231a1 Mon Sep 17 00:00:00 2001 From: Kei Oshima Date: Wed, 29 Nov 2023 22:27:38 -0500 Subject: [PATCH 8/8] reformatting with black --- machine-learning-client/tests/ml_tests.py | 12 ++++++------ web-app/app.py | 11 ++++------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/machine-learning-client/tests/ml_tests.py b/machine-learning-client/tests/ml_tests.py index 457ab25..693df8b 100644 --- a/machine-learning-client/tests/ml_tests.py +++ b/machine-learning-client/tests/ml_tests.py @@ -4,15 +4,15 @@ from machine_learning_client import ML - - class Tests: - """ Tests class for ml_tests.py """ + """Tests class for ml_tests.py""" + def test_audio_text_conversion(self): """testing audio_to_text function in ML with valid audiofile as input""" - actual = ML.audio_to_text(self, + actual = ML.audio_to_text( + self, r"C:\Users\Administrator\Desktop\NYU_Undergrad\SoftwareEngineering" - r"\4-containerized-app-exercise-rizzballs\machine-learning-client\tests\richard.aiff" + r"\4-containerized-app-exercise-rizzballs\machine-learning-client\tests\richard.aiff", ) assert isinstance( actual, str @@ -30,5 +30,5 @@ def test_grade_response(self): assert ( actual.lower() == "your response had hello appearing 5 times ugh appearing 0 times " - ),f"Expected the result to be 'your response had hello appearing 5 times \ + ), f"Expected the result to be 'your response had hello appearing 5 times \ ugh appearing 0 times '. Instead it returned {actual}" diff --git a/web-app/app.py b/web-app/app.py index f79a502..dac1023 100644 --- a/web-app/app.py +++ b/web-app/app.py @@ -1,4 +1,3 @@ - """ app.py file that helps serve as the front end of our application """ @@ -39,13 +38,13 @@ def analyze_data(): result = subprocess.run( [ "C:\\Users\\Andrew - User\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe", - "E:\\4-containerized-app-exercise-rizzballs\\machine-learning-client\\machine_learning_client.py", # pylint: disable=line-too-long - audio_path, # pylint: disable=line-too-long disable=trailing-whitespace + "E:\\4-containerized-app-exercise-rizzballs\\machine-learning-client\\machine_learning_client.py", # pylint: disable=line-too-long + audio_path, # pylint: disable=line-too-long disable=trailing-whitespace ], capture_output=True, text=True, - check=True - ) + check=True, + ) if result.returncode == 0: print("Process succeeded!") else: @@ -60,8 +59,6 @@ def analyze_data(): return jsonify({"status": "error", "message": f"Subprocess failed: {str(e)}"}) - - if __name__ == "__main__": PORT = os.getenv("PORT", "5000") app.run(debug=True, port=PORT)