diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000000..32fd9730fb --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,33 @@ +name: CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.7.1", "3.8", "3.9", "3.10", "3.11"] + + # This job sets up Python versions using Python images instead of + # actions/setup-python because Python 3.7.1 does not exist in + # the GitHub local cache. Once the support for Python 3.7.1 is + # dropped, this job can be simplified to use actions/setup-python. + container: + image: python:${{ matrix.python-version }} + + steps: + - uses: actions/checkout@v3 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -e .[dev,datalib,wandb,embeddings] + - name: Test with pytest + run: python -m pytest + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} diff --git a/.gitignore b/.gitignore index 7ad641a0c8..5bffd45b87 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /public/dist __pycache__ build +dist *.egg .vscode/settings.json .ipynb_checkpoints diff --git a/openai/validators.py b/openai/validators.py index 078179a44b..8237bce731 100644 --- a/openai/validators.py +++ b/openai/validators.py @@ -423,7 +423,7 @@ def completions_space_start_validator(df): def add_space_start(x): x["completion"] = x["completion"].apply( - lambda x: ("" if x[0] == " " else " ") + x + lambda x: ("" if x == "" or x[0] == " " else " ") + x ) return x