Upload fuzz/runner.py with huggingface_hub
Browse files- fuzz/runner.py +12 -0
fuzz/runner.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import tensorflow as tf
|
| 2 |
+
import numpy as np
|
| 3 |
+
import sys
|
| 4 |
+
try:
|
| 5 |
+
interp = tf.lite.Interpreter(model_path=sys.argv[1])
|
| 6 |
+
interp.allocate_tensors()
|
| 7 |
+
for d in interp.get_input_details():
|
| 8 |
+
interp.set_tensor(d[index], np.zeros(d[shape], dtype=d[dtype]))
|
| 9 |
+
interp.invoke()
|
| 10 |
+
print(EXECUTED)
|
| 11 |
+
except Exception as e:
|
| 12 |
+
print(type(e).__name__)
|