Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* add cost budget; move loc of make_dir

* support openai completion

* install pytest in workflow

* skip openai test

* test openai

* path for docs rebuild

* install datasets

* signal

* notebook

* notebook in workflow

* optional arguments and special params

* key -> k

* improve readability

* assumption

* optimize for model selection

* larger range of max_tokens

* notebook

* python package workflow

* skip on win
  • Loading branch information
sonichi authored Feb 6, 2023
1 parent bcc6a19 commit 63d350d
Show file tree
Hide file tree
Showing 12 changed files with 2,366 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@ name: docs
on:
pull_request:
branches: [main]
path:
- 'flaml/*'
- 'website/*'
- '.github/workflows/deploy-website.yml'
push:
branches: [main]
path:
- 'flaml/*'
- 'website/*'
- '.github/workflows/deploy-website.yml'
workflow_dispatch:

jobs:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/openai.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: OpenAI

on:
pull_request:
branches: ['main']
path:
- 'flaml/integrations/oai/*'
- 'test/openai/*'
- '.github/workflows/openai.yml'

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
runs-on: ${{ matrix.os }}
environment: openai
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -e .
python -c "import flaml"
pip install -e .[openai]
- name: Coverage
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
pip install coverage pytest datasets nbconvert nbformat ipykernel
coverage run -a -m pytest test/openai
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
12 changes: 12 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,20 @@ name: Build
on:
push:
branches: ['main']
path:
- 'flaml/*'
- 'test/*'
- 'notebook/*'
- '.github/workflows/python-package.yml'
- 'setup.py'
pull_request:
branches: ['main']
path:
- 'flaml/*'
- 'test/*'
- 'notebook/*'
- '.github/workflows/python-package.yml'
- 'setup.py'

jobs:
build:
Expand Down
4 changes: 3 additions & 1 deletion flaml/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import logging
from flaml.automl import AutoML, logger_formatter
from flaml.tune.searcher import CFO, BlendSearch, FLOW2, BlendSearchTuner, RandomSearch
from flaml.onlineml.autovw import AutoVW
from flaml.integrations import oai
from flaml.version import __version__
import logging


# Set the root logger.
logger = logging.getLogger(__name__)
Expand Down
Empty file added flaml/integrations/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions flaml/integrations/oai/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from flaml.integrations.oai.completion import Completion

__all__ = ["Completion"]
Loading

0 comments on commit 63d350d

Please sign in to comment.