added - execution time
This commit is contained in:
parent
0ed9df53f5
commit
93c6317a1e
5
main.py
5
main.py
@ -1,5 +1,6 @@
|
||||
import argparse
|
||||
from helpers.audio_analysis import UrduIntentExtractor
|
||||
import time
|
||||
|
||||
def main():
|
||||
"""
|
||||
@ -38,11 +39,14 @@ def main():
|
||||
# Initialize extractor
|
||||
extractor = UrduIntentExtractor(model_size=args.model)
|
||||
|
||||
start_time = time.time()
|
||||
# Process audio file
|
||||
results = extractor.process_audio_file(
|
||||
args.audio_file,
|
||||
verbose=not args.quiet
|
||||
)
|
||||
end_time = time.time()
|
||||
print(f"⏱️ Execution time: {(end_time - start_time) / 60:.2f} minutes, {(end_time - start_time)} seconds")
|
||||
|
||||
# Save to JSON if requested
|
||||
if args.output:
|
||||
@ -52,6 +56,7 @@ def main():
|
||||
print(f"\nResults saved to: {args.output}")
|
||||
|
||||
except FileNotFoundError as e:
|
||||
print(f"⏱️ Execution time: {(end_time - start_time) / 60:.2f} minutes, {(end_time - start_time)} seconds")
|
||||
print(f"❌ Error: {e}")
|
||||
except Exception as e:
|
||||
print(f"❌ An error occurred: {str(e)}")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user