-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use eleven_multilingual_v2 model for improved stability, accuracy and…
… quality
- Loading branch information
1 parent
f14f71d
commit 162f886
Showing
5 changed files
with
93 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import asyncio | ||
from functools import wraps | ||
from time import time | ||
|
||
|
||
def process_time(): | ||
"""Print process execution time for a given function""" | ||
|
||
def decorator(func): | ||
if asyncio.iscoroutinefunction(func): | ||
|
||
@wraps(func) | ||
async def async_wrapper(*args, **kwargs): | ||
start_time = time() | ||
response = await func(*args, **kwargs) | ||
|
||
time_diff = f"{(time() - start_time):.2f}s" | ||
print(f"Execution time for {func.__name__}: {time_diff}") | ||
|
||
return response | ||
|
||
return async_wrapper | ||
|
||
@wraps(func) | ||
def wrapper(*args, **kwargs): | ||
start_time = time() | ||
response = func(*args, **kwargs) | ||
|
||
time_diff = f"{(time() - start_time):.2f}s" | ||
print(f"Execution time for {func.__name__}: {time_diff}") | ||
|
||
return response | ||
|
||
return wrapper | ||
|
||
return decorator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters