win2win commited on
Commit
5056323
·
verified ·
1 Parent(s): efc75a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -3,10 +3,15 @@ from transformers import pipeline
3
  import gradio as gr
4
 
5
 
6
- import os
 
 
 
 
 
 
 
7
 
8
- # Disable xformers warning
9
- os.environ["USE_XFORMERS"] = "0"
10
 
11
  app = FastAPI()
12
  model = pipeline("text-classification", model="win2win/3-epochs-classifier-ver2")
 
3
  import gradio as gr
4
 
5
 
6
+ import warnings
7
+ from transformers.utils import is_xformers_available
8
+
9
+ # Monkey-patch the xformers check
10
+ def fake_xformers_available():
11
+ return False
12
+
13
+ is_xformers_available = fake_xformers_available
14
 
 
 
15
 
16
  app = FastAPI()
17
  model = pipeline("text-classification", model="win2win/3-epochs-classifier-ver2")