Skip to content

Commit

Permalink
chore: add license generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Minh141120 committed Jan 23, 2025
1 parent b2b666b commit 30a9771
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/convert-model-all-quant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,14 @@ jobs:
]
)
overview = completion.choices[0].message.content.strip()
model_dir = f"/mnt/models/{model_name}/hf"
licenses = []
for filename in os.listdir(model_dir):
if filename.startswith('LICENSE'):
license_url = f"https://huggingface.co/{source_model_id}/blob/main/{filename}"
licenses.append(f"[{filename}]({license_url})")
license_links = " | ".join(licenses) if licenses else "[License](#)"
# README.md template
readme_template = f"""\
Expand Down Expand Up @@ -167,7 +174,7 @@ jobs:
- **Author:** {author}
- **Converter:** [Homebrew](https://www.homebrew.ltd/)
- **Original License:** [License](#)
- **Original License:** {license_links}
"""
# Write the README.md file
Expand Down

0 comments on commit 30a9771

Please sign in to comment.