Skip to content

Commit

Permalink
auto-update model count
Browse files Browse the repository at this point in the history
  • Loading branch information
pkelaita committed May 14, 2024
1 parent 69b9920 commit a76894e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# L2M2: A Simple Python LLM Manager 💬👍

[![Tests](https://github.com/pkelaita/l2m2/actions/workflows/tests.yml/badge.svg?timestamp=1715663614)](https://github.com/pkelaita/l2m2/actions/workflows/tests.yml) [![Coverage Status](https://coveralls.io/repos/github/pkelaita/l2m2/badge.svg?branch=main)](https://coveralls.io/github/pkelaita/l2m2?branch=main) [![PyPI version](https://badge.fury.io/py/l2m2.svg?timestamp=1715663614)](https://badge.fury.io/py/l2m2)
[![Tests](https://github.com/pkelaita/l2m2/actions/workflows/tests.yml/badge.svg?timestamp=1715664306)](https://github.com/pkelaita/l2m2/actions/workflows/tests.yml) [![Coverage Status](https://coveralls.io/repos/github/pkelaita/l2m2/badge.svg?branch=main)](https://coveralls.io/github/pkelaita/l2m2?branch=main) [![PyPI version](https://badge.fury.io/py/l2m2.svg?timestamp=1715664306)](https://badge.fury.io/py/l2m2)

**L2M2** ("LLM Manager" → "LLMM" → "L2M2") is a very simple LLM manager for Python that exposes lots of models through a unified API. This is useful for evaluation, demos, and other apps that need to easily be model-agnostic.

## Features

- 13 supported models (see below) through a unified interface – regularly updated and with more on the way
- <!--start-count-->14<!--end-count--> supported models (see below) through a unified interface – regularly updated and with more on the way
- Asynchronous and concurrent calls
- Session chat memory – even across multiple models

Expand Down
17 changes: 12 additions & 5 deletions scripts/update_model_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,23 @@ def make_row(model_name):
markdown_table = "\n\n" + header + sep + rows + "\n"

readme_path = "../README.md"
start_marker = "<!--start-model-table-->"
end_marker = "<!--end-model-table-->"
table_start = "<!--start-model-table-->"
table_end = "<!--end-model-table-->"
count_start = "<!--start-count-->"
count_end = "<!--end-count-->"

with open(readme_path, "r") as f:
readme = f.read()
new_readme = readme.replace(
readme[readme.index(start_marker) : readme.index(end_marker) + len(end_marker)],
start_marker + markdown_table + end_marker,
readme[readme.index(table_start) : readme.index(table_end) + len(table_end)],
f"{table_start}{markdown_table}{table_end}",
).replace(
readme[readme.index(count_start) : readme.index(count_end) + len(count_end)],
f"{count_start}{len(MODEL_INFO)}{count_end}",
)


with open(readme_path, "w") as f:
f.write(new_readme)
print(f"Updated {readme_path} with model table")

print("Updated model table in README.md")

0 comments on commit a76894e

Please sign in to comment.