Skip to content

Commit

Permalink
feat: Models setup, mypy type check
Browse files Browse the repository at this point in the history
  • Loading branch information
RezaRahemtola committed Aug 15, 2024
1 parent 734d7e5 commit 463cc43
Show file tree
Hide file tree
Showing 5 changed files with 1,145 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
push:

jobs:
mypy:
name: mypy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'poetry'
- name: Install dependencies
run: poetry install
- uses: tsuyoshicho/action-mypy@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-check
target: libertai_agents
execute_command: 'poetry run mypy'
11 changes: 11 additions & 0 deletions libertai_agents/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from transformers import AutoTokenizer, PreTrainedTokenizerFast


class Model:
tokenizer: PreTrainedTokenizerFast

def __init__(self, model_id: str):
self.tokenizer = AutoTokenizer.from_pretrained(model_id)


Hermes2Pro = Model(model_id="NousResearch/Hermes-2-Pro-Llama-3-8B")
4 changes: 4 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[mypy]

[mypy-transformers.*]
ignore_missing_imports = True
Loading

0 comments on commit 463cc43

Please sign in to comment.