feynmanl commited on
Commit
882f162
·
1 Parent(s): a043fbb

Use token envvar

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,8 +1,12 @@
1
  import gradio as gr
 
2
 
3
  from transformers import pipeline
4
 
5
- pipe = pipeline(model="fmops/ai-traffic-classifier")
 
 
 
6
  id2label = {
7
  'LABEL_0': 'not ai traffic',
8
  'LABEL_1': 'suspected ai traffic'
 
1
  import gradio as gr
2
+ import os
3
 
4
  from transformers import pipeline
5
 
6
+
7
+ auth_token = os.environ.get("HF_ACCESS_TOKEN") or True
8
+
9
+ pipe = pipeline(model="fmops/ai-traffic-classifier", use_auth_token=auth_token)
10
  id2label = {
11
  'LABEL_0': 'not ai traffic',
12
  'LABEL_1': 'suspected ai traffic'