ktrapeznikov commited on
Commit
838bef0
·
verified ·
1 Parent(s): 79fb638

Update script.py

Browse files

adding test to make sure network access is blocked

Files changed (1) hide show
  1. script.py +9 -1
script.py CHANGED
@@ -23,7 +23,15 @@ from preprocess import preprocess
23
  DATASET_PATH = "/tmp/data"
24
  dataset_remote = load_dataset(DATASET_PATH,split = "test",streaming = True)
25
 
26
-
 
 
 
 
 
 
 
 
27
  # load your model
28
  device = "cuda:0"
29
  model = Model().to(device)
 
23
  DATASET_PATH = "/tmp/data"
24
  dataset_remote = load_dataset(DATASET_PATH,split = "test",streaming = True)
25
 
26
+ # this should fail since there is not network access during model run
27
+ try:
28
+ import requests
29
+ r = requests.get("https://stresearch.github.io/SAFE/logo.jpg")
30
+ print(r.text)
31
+ except Exception as e:
32
+ print("download test faild as expected")
33
+ print(e)
34
+
35
  # load your model
36
  device = "cuda:0"
37
  model = Model().to(device)