arina-hf-spaces-api / app /core /custom_warnings.py
adsurkasur's picture
clone from arina-hf-spaces
68964c2
raw
history blame contribute delete
389 Bytes
import warnings
def custom_warning_filter(message, category, filename, lineno, file=None, line=None):
if "Torch was not compiled with flash attention" in str(message):
return # Suppress this specific warning
warnings.defaultaction(message, category, filename, lineno, file, line)
def custom_warning():
warnings.showwarning = custom_warning_filter # Apply the filter