Spaces:
Build error
Build error
Commit
·
e1cd6af
1
Parent(s):
c070f8c
:bug: really make sure log_files/ exists
Browse files- app.py +2 -2
- data_measurements/dataset_statistics.py +3 -0
- data_measurements/npmi.py +3 -0
- data_measurements/zipf.py +3 -0
app.py
CHANGED
|
@@ -15,6 +15,7 @@
|
|
| 15 |
import logging
|
| 16 |
from os import mkdir
|
| 17 |
from os.path import isdir
|
|
|
|
| 18 |
|
| 19 |
import streamlit as st
|
| 20 |
|
|
@@ -27,8 +28,7 @@ logs.propagate = False
|
|
| 27 |
|
| 28 |
if not logs.handlers:
|
| 29 |
|
| 30 |
-
|
| 31 |
-
mkdir("./log_files/")
|
| 32 |
|
| 33 |
# Logging info to log file
|
| 34 |
file = logging.FileHandler("./log_files/app.log")
|
|
|
|
| 15 |
import logging
|
| 16 |
from os import mkdir
|
| 17 |
from os.path import isdir
|
| 18 |
+
from pathlib import Path
|
| 19 |
|
| 20 |
import streamlit as st
|
| 21 |
|
|
|
|
| 28 |
|
| 29 |
if not logs.handlers:
|
| 30 |
|
| 31 |
+
Path('./log_files').mkdir(exist_ok=True)
|
|
|
|
| 32 |
|
| 33 |
# Logging info to log file
|
| 34 |
file = logging.FileHandler("./log_files/app.log")
|
data_measurements/dataset_statistics.py
CHANGED
|
@@ -18,6 +18,7 @@ import statistics
|
|
| 18 |
from os import mkdir
|
| 19 |
from os.path import exists, isdir
|
| 20 |
from os.path import join as pjoin
|
|
|
|
| 21 |
|
| 22 |
import nltk
|
| 23 |
import numpy as np
|
|
@@ -58,6 +59,8 @@ logs.propagate = False
|
|
| 58 |
|
| 59 |
if not logs.handlers:
|
| 60 |
|
|
|
|
|
|
|
| 61 |
# Logging info to log file
|
| 62 |
file = logging.FileHandler("./log_files/dataset_statistics.log")
|
| 63 |
fileformat = logging.Formatter("%(asctime)s:%(message)s")
|
|
|
|
| 18 |
from os import mkdir
|
| 19 |
from os.path import exists, isdir
|
| 20 |
from os.path import join as pjoin
|
| 21 |
+
from pathlib import Path
|
| 22 |
|
| 23 |
import nltk
|
| 24 |
import numpy as np
|
|
|
|
| 59 |
|
| 60 |
if not logs.handlers:
|
| 61 |
|
| 62 |
+
Path('./log_files').mkdir(exist_ok=True)
|
| 63 |
+
|
| 64 |
# Logging info to log file
|
| 65 |
file = logging.FileHandler("./log_files/dataset_statistics.log")
|
| 66 |
fileformat = logging.Formatter("%(asctime)s:%(message)s")
|
data_measurements/npmi.py
CHANGED
|
@@ -14,6 +14,7 @@
|
|
| 14 |
|
| 15 |
import logging
|
| 16 |
import warnings
|
|
|
|
| 17 |
|
| 18 |
import numpy as np
|
| 19 |
import pandas as pd
|
|
@@ -33,6 +34,8 @@ logs.propagate = False
|
|
| 33 |
|
| 34 |
if not logs.handlers:
|
| 35 |
|
|
|
|
|
|
|
| 36 |
# Logging info to log file
|
| 37 |
file = logging.FileHandler("./log_files/npmi.log")
|
| 38 |
fileformat = logging.Formatter("%(asctime)s:%(message)s")
|
|
|
|
| 14 |
|
| 15 |
import logging
|
| 16 |
import warnings
|
| 17 |
+
from pathlib import Path
|
| 18 |
|
| 19 |
import numpy as np
|
| 20 |
import pandas as pd
|
|
|
|
| 34 |
|
| 35 |
if not logs.handlers:
|
| 36 |
|
| 37 |
+
Path('./log_files').mkdir(exist_ok=True)
|
| 38 |
+
|
| 39 |
# Logging info to log file
|
| 40 |
file = logging.FileHandler("./log_files/npmi.log")
|
| 41 |
fileformat = logging.Formatter("%(asctime)s:%(message)s")
|
data_measurements/zipf.py
CHANGED
|
@@ -13,6 +13,7 @@
|
|
| 13 |
# limitations under the License.
|
| 14 |
|
| 15 |
import logging
|
|
|
|
| 16 |
|
| 17 |
import numpy as np
|
| 18 |
import pandas as pd
|
|
@@ -33,6 +34,8 @@ logs.propagate = False
|
|
| 33 |
|
| 34 |
if not logs.handlers:
|
| 35 |
|
|
|
|
|
|
|
| 36 |
# Logging info to log file
|
| 37 |
file = logging.FileHandler("./log_files/zipf.log")
|
| 38 |
fileformat = logging.Formatter("%(asctime)s:%(message)s")
|
|
|
|
| 13 |
# limitations under the License.
|
| 14 |
|
| 15 |
import logging
|
| 16 |
+
from pathlib import Path
|
| 17 |
|
| 18 |
import numpy as np
|
| 19 |
import pandas as pd
|
|
|
|
| 34 |
|
| 35 |
if not logs.handlers:
|
| 36 |
|
| 37 |
+
Path('./log_files').mkdir(exist_ok=True)
|
| 38 |
+
|
| 39 |
# Logging info to log file
|
| 40 |
file = logging.FileHandler("./log_files/zipf.log")
|
| 41 |
fileformat = logging.Formatter("%(asctime)s:%(message)s")
|