Add tracing
Browse files- handler.py +11 -0
handler.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
from typing import Dict, List, Any
|
| 2 |
from transformers import pipeline
|
| 3 |
import holidays
|
|
|
|
|
|
|
| 4 |
|
| 5 |
|
| 6 |
class EndpointHandler:
|
|
@@ -16,6 +18,15 @@ class EndpointHandler:
|
|
| 16 |
Return:
|
| 17 |
A :obj:`list` | `dict`: will be serialized and returned
|
| 18 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
# get inputs
|
| 20 |
inputs = data.pop("inputs", data)
|
| 21 |
# get additional date field
|
|
|
|
| 1 |
from typing import Dict, List, Any
|
| 2 |
from transformers import pipeline
|
| 3 |
import holidays
|
| 4 |
+
import sys
|
| 5 |
+
import os
|
| 6 |
|
| 7 |
|
| 8 |
class EndpointHandler:
|
|
|
|
| 18 |
Return:
|
| 19 |
A :obj:`list` | `dict`: will be serialized and returned
|
| 20 |
"""
|
| 21 |
+
print('sys.executable', sys.executable)
|
| 22 |
+
print('sys.version', sys.version)
|
| 23 |
+
print('os.getcwd', os.getcwd())
|
| 24 |
+
print('__file__', __file__)
|
| 25 |
+
print('ls')
|
| 26 |
+
os.system('ls')
|
| 27 |
+
print('ls ..')
|
| 28 |
+
os.system('ls ..')
|
| 29 |
+
|
| 30 |
# get inputs
|
| 31 |
inputs = data.pop("inputs", data)
|
| 32 |
# get additional date field
|