Spaces:
Sleeping
Sleeping
Abid Ali Awan
commited on
Commit
·
ca9beed
1
Parent(s):
9f507de
Refactor app.py to simplify warning suppression by using a general filter for FutureWarnings, enhancing code maintainability.
Browse files
app.py
CHANGED
|
@@ -11,11 +11,7 @@ from transformers import (
|
|
| 11 |
pipeline,
|
| 12 |
)
|
| 13 |
|
| 14 |
-
warnings.
|
| 15 |
-
"ignore",
|
| 16 |
-
message="The input name `inputs` is deprecated. Please make sure to use `input_features` instead.",
|
| 17 |
-
category=FutureWarning,
|
| 18 |
-
)
|
| 19 |
|
| 20 |
# —— CPU performance tweaks ——
|
| 21 |
os.environ["OMP_NUM_THREADS"] = "4"
|
|
|
|
| 11 |
pipeline,
|
| 12 |
)
|
| 13 |
|
| 14 |
+
warnings.simplefilter("ignore", FutureWarning)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
# —— CPU performance tweaks ——
|
| 17 |
os.environ["OMP_NUM_THREADS"] = "4"
|