rmayormartins commited on
Commit
a189251
1 Parent(s): 85fab11

Atualização do app.py com função extract_tm_info

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -5,6 +5,18 @@ import pandas as pd
5
  from tensorflow.keras.models import model_from_json
6
  from collections import Counter
7
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  def extract_zip_info(zip_path):
9
  with zipfile.ZipFile(zip_path, 'r') as zip_ref:
10
  file_list = zip_ref.namelist()
 
5
  from tensorflow.keras.models import model_from_json
6
  from collections import Counter
7
 
8
+ def extract_tm_info(tm_path):
9
+ with zipfile.ZipFile(tm_path, 'r') as zip_ref:
10
+ with zip_ref.open('manifest.json') as f:
11
+ manifest = json.load(f)
12
+ return {
13
+ 'type': manifest.get('type', 'N/A'),
14
+ 'version': manifest.get('version', 'N/A'),
15
+ 'epochs': manifest.get('appdata', {}).get('trainEpochs', 'N/A'),
16
+ 'batch_size': manifest.get('appdata', {}).get('trainBatchSize', 'N/A'),
17
+ 'learning_rate': manifest.get('appdata', {}).get('trainLearningRate', 'N/A')
18
+ }
19
+
20
  def extract_zip_info(zip_path):
21
  with zipfile.ZipFile(zip_path, 'r') as zip_ref:
22
  file_list = zip_ref.namelist()