a1c00l commited on
Commit
d1e3434
·
verified ·
1 Parent(s): cae1223

Update src/aibom_generator/cli.py

Browse files
Files changed (1) hide show
  1. src/aibom_generator/cli.py +5 -5
src/aibom_generator/cli.py CHANGED
@@ -14,7 +14,7 @@ from aibom_generator.generator import AIBOMGenerator
14
  def parse_args():
15
  """Parse command line arguments."""
16
  parser = argparse.ArgumentParser(
17
- description="Generate AI Bills of Materials (AIBOMs) in CycloneDX format for Hugging Face models."
18
  )
19
 
20
  parser.add_argument(
@@ -104,24 +104,24 @@ def main():
104
 
105
  # Check if it meets the threshold
106
  if completeness_score < args.completeness_threshold:
107
- print(f"Warning: AIBOM completeness score ({completeness_score}) is below threshold ({args.completeness_threshold})")
108
 
109
  # Save the output
110
  save_output(aibom, args.output, args.format, args.pretty)
111
 
112
- print(f"AIBOM generated successfully: {args.output}")
113
  print(f"Completeness score: {completeness_score}/100")
114
 
115
  return 0
116
 
117
  except Exception as e:
118
- print(f"Error generating AIBOM: {e}", file=sys.stderr)
119
  return 1
120
 
121
 
122
  def calculate_completeness_score(aibom):
123
  """
124
- Calculate a completeness score for the AIBOM.
125
 
126
  This is a placeholder implementation that will be replaced with a more
127
  sophisticated scoring algorithm based on the field mapping framework.
 
14
  def parse_args():
15
  """Parse command line arguments."""
16
  parser = argparse.ArgumentParser(
17
+ description="Generate AI Software Bill of Materials (AI SBOMs) in CycloneDX format for Hugging Face models."
18
  )
19
 
20
  parser.add_argument(
 
104
 
105
  # Check if it meets the threshold
106
  if completeness_score < args.completeness_threshold:
107
+ print(f"Warning: AI SBOM completeness score ({completeness_score}) is below threshold ({args.completeness_threshold})")
108
 
109
  # Save the output
110
  save_output(aibom, args.output, args.format, args.pretty)
111
 
112
+ print(f"AI SBOM generated successfully: {args.output}")
113
  print(f"Completeness score: {completeness_score}/100")
114
 
115
  return 0
116
 
117
  except Exception as e:
118
+ print(f"Error generating AI SBOM: {e}", file=sys.stderr)
119
  return 1
120
 
121
 
122
  def calculate_completeness_score(aibom):
123
  """
124
+ Calculate a completeness score for the AI SBOM.
125
 
126
  This is a placeholder implementation that will be replaced with a more
127
  sophisticated scoring algorithm based on the field mapping framework.