gagan3012 commited on
Commit
3e20595
·
1 Parent(s): da13cde
dvc.yaml CHANGED
@@ -26,7 +26,7 @@ stages:
26
  - models:
27
  persist: true
28
  metrics:
29
- - reports/training_metrics.csv:
30
  cache: false
31
  eval:
32
  cmd: python src/models/evaluate_model.py
 
26
  - models:
27
  persist: true
28
  metrics:
29
+ - reports/training_metrics.txt:
30
  cache: false
31
  eval:
32
  cmd: python src/models/evaluate_model.py
reports/{training_metrics.csv → training_metrics.txt} RENAMED
File without changes
src/models/model.py CHANGED
@@ -332,7 +332,7 @@ class Summarization:
332
 
333
  WandLogger = WandbLogger(project="summarization-dagshub")
334
 
335
- # logger = DAGsHubLogger(metrics_path='reports/training_metrics.csv')
336
 
337
  early_stop_callback = (
338
  [
 
332
 
333
  WandLogger = WandbLogger(project="summarization-dagshub")
334
 
335
+ # logger = DAGsHubLogger(metrics_path='reports/training_metrics.txt')
336
 
337
  early_stop_callback = (
338
  [
src/models/train_model.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  import yaml
2
 
3
  from model import Summarization
@@ -28,8 +30,11 @@ def train_model():
28
 
29
  model.save_model(model_dir=params['model_dir'])
30
 
31
- df = pd.read_json(r'wandb/latest-run/files/wandb-summary.json',typ='series')
32
- df.to_csv(r'reports/training_metrics.csv', index=False)
 
 
 
33
 
34
 
35
  if __name__ == '__main__':
 
1
+ import json
2
+
3
  import yaml
4
 
5
  from model import Summarization
 
30
 
31
  model.save_model(model_dir=params['model_dir'])
32
 
33
+ with open('wandb/latest-run/files/wandb-summary.json') as json_file:
34
+ data = json.load(json_file)
35
+
36
+ with open('reports/training_metrics.txt', 'w') as fp:
37
+ json.dump(data, fp)
38
 
39
 
40
  if __name__ == '__main__':