push
push push
This commit is contained in:
@@ -11,7 +11,7 @@ def read_files(path, output, filetypes=None):
|
|||||||
for root, dirs, files in os.walk(path):
|
for root, dirs, files in os.walk(path):
|
||||||
for file in files:
|
for file in files:
|
||||||
if (file_type := file.split(".")[-1]) in filetypes:
|
if (file_type := file.split(".")[-1]) in filetypes:
|
||||||
output.append((file_type, os.path.join(path, file)))
|
output.append((file_type, os.path.join(path, file), file))
|
||||||
|
|
||||||
for folder in dirs:
|
for folder in dirs:
|
||||||
read_files(os.path.join(path, folder), output)
|
read_files(os.path.join(path, folder), output)
|
||||||
|
|||||||
@@ -21,11 +21,14 @@ def retrieve_file_contents(path):
|
|||||||
contents.append({
|
contents.append({
|
||||||
"type": file[0],
|
"type": file[0],
|
||||||
"path": file[1],
|
"path": file[1],
|
||||||
|
"filename": file[2],
|
||||||
"content": content
|
"content": content
|
||||||
})
|
})
|
||||||
|
|
||||||
return contents
|
return contents
|
||||||
|
|
||||||
contents = retrieve_file_contents("C:\\SoftwareEng")
|
contents = retrieve_file_contents("C:\\Users\\afist\\Downloads\\SoftwareEng")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print(json.dumps(contents, indent="\t"))
|
print(json.dumps(contents, indent="\t"))
|
||||||
+1
-1
@@ -5,7 +5,7 @@ import json
|
|||||||
model = whisper.load_model('tiny')
|
model = whisper.load_model('tiny')
|
||||||
|
|
||||||
|
|
||||||
result = model.transcribe(str("Aufzeichnung.mp3"), language='de', verbose=True)
|
result = model.transcribe(str("C:\\Users\\afist\\Downloads\\Aufzeichnung.mp3"), language='de', verbose=True)
|
||||||
|
|
||||||
# Dump the results to a JSON file
|
# Dump the results to a JSON file
|
||||||
with open('transcript.json', "w") as file:
|
with open('transcript.json', "w") as file:
|
||||||
|
|||||||
Reference in New Issue
Block a user