aliasgerovs commited on
Commit
1c49ee1
1 Parent(s): 2bd675e

Updated mc with isotonic.

Browse files
Files changed (2) hide show
  1. nohup.out +44 -0
  2. predictors.py +12 -7
nohup.out CHANGED
@@ -99,3 +99,47 @@ error: externally-managed-environment
99
 
100
  note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
101
  hint: See PEP 668 for the detailed specification.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
 
100
  note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
101
  hint: See PEP 668 for the detailed specification.
102
+ 2024-03-27 15:11:04.526493: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
103
+ 2024-03-27 15:11:04.526578: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
104
+ 2024-03-27 15:11:04.528324: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
105
+ 2024-03-27 15:11:04.536839: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
106
+ To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
107
+ 2024-03-27 15:11:05.847612: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
108
+ [nltk_data] Downloading package punkt to /root/nltk_data...
109
+ [nltk_data] Package punkt is already up-to-date!
110
+ [nltk_data] Downloading package punkt to /root/nltk_data...
111
+ [nltk_data] Package punkt is already up-to-date!
112
+ [nltk_data] Downloading package stopwords to /root/nltk_data...
113
+ [nltk_data] Package stopwords is already up-to-date!
114
+ [nltk_data] Downloading package punkt to /root/nltk_data...
115
+ [nltk_data] Package punkt is already up-to-date!
116
+ [nltk_data] Downloading package punkt to /root/nltk_data...
117
+ [nltk_data] Package punkt is already up-to-date!
118
+ [nltk_data] Downloading package stopwords to /root/nltk_data...
119
+ [nltk_data] Package stopwords is already up-to-date!
120
+ error: externally-managed-environment
121
+
122
+ × This environment is externally managed
123
+ ╰─> To install Python packages system-wide, try apt install
124
+ python3-xyz, where xyz is the package you are trying to
125
+ install.
126
+
127
+ If you wish to install a non-Debian-packaged Python package,
128
+ create a virtual environment using python3 -m venv path/to/venv.
129
+ Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
130
+ sure you have python3-full installed.
131
+
132
+ If you wish to install a non-Debian packaged Python application,
133
+ it may be easiest to use pipx install xyz, which will manage a
134
+ virtual environment for you. Make sure you have pipx installed.
135
+
136
+ See /usr/share/doc/python3.11/README.venv for more information.
137
+
138
+ note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
139
+ hint: See PEP 668 for the detailed specification.
140
+ /home/aliasgarov/copyright_checker/predictors.py:197: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.
141
+ probas = F.softmax(tensor_logits).detach().cpu().numpy()
142
+ /home/aliasgarov/copyright_checker/predictors.py:197: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.
143
+ probas = F.softmax(tensor_logits).detach().cpu().numpy()
144
+ /home/aliasgarov/copyright_checker/predictors.py:197: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.
145
+ probas = F.softmax(tensor_logits).detach().cpu().numpy()
predictors.py CHANGED
@@ -276,11 +276,11 @@ def predict_bc_scores(input):
276
  average_bc_scores = np.mean(bc_scores_array, axis=0)
277
  bc_score_list = average_bc_scores.tolist()
278
  print(f"Original BC scores: AI: {bc_score_list[1]}, HUMAN: {bc_score_list[0]}")
279
- # # isotonic regression calibration
280
- # ai_score = iso_reg.predict([bc_score_list[1]])[0]
281
- # human_score = 1 - ai_score
282
- bc_score = {"AI": bc_score_list[1], "HUMAN": bc_score_list[0]}
283
- # print(f"Calibration BC scores: AI: {ai_score}, HUMAN: {human_score}")
284
  return bc_score
285
 
286
 
@@ -330,8 +330,13 @@ def predict_1on1_scores(input, models):
330
  bc_scores_array = np.array(bc_scores)
331
  average_bc_scores = np.mean(bc_scores_array, axis=0)
332
  bc_score_list = average_bc_scores.tolist()
333
- bc_score = {"AI": bc_score_list[1], "HUMAN": bc_score_list[0]}
334
-
 
 
 
 
 
335
  # MC SCORE
336
  if len(models) > 1:
337
  print("Starting MC")
 
276
  average_bc_scores = np.mean(bc_scores_array, axis=0)
277
  bc_score_list = average_bc_scores.tolist()
278
  print(f"Original BC scores: AI: {bc_score_list[1]}, HUMAN: {bc_score_list[0]}")
279
+ # isotonic regression calibration
280
+ ai_score = iso_reg.predict([bc_score_list[1]])[0]
281
+ human_score = 1 - ai_score
282
+ bc_score = {"AI": ai_score, "HUMAN": human_score}
283
+ print(f"Calibration BC scores: AI: {ai_score}, HUMAN: {human_score}")
284
  return bc_score
285
 
286
 
 
330
  bc_scores_array = np.array(bc_scores)
331
  average_bc_scores = np.mean(bc_scores_array, axis=0)
332
  bc_score_list = average_bc_scores.tolist()
333
+ print(f"Original BC scores: AI: {bc_score_list[1]}, HUMAN: {bc_score_list[0]}")
334
+ # isotonic regression calibration
335
+ ai_score = iso_reg.predict([bc_score_list[1]])[0]
336
+ human_score = 1 - ai_score
337
+ bc_score = {"AI": ai_score, "HUMAN": human_score}
338
+ print(f"Calibration BC scores: AI: {ai_score}, HUMAN: {human_score}")
339
+
340
  # MC SCORE
341
  if len(models) > 1:
342
  print("Starting MC")