Skip to content

Commit

Permalink
Add guard to hegel import
Browse files Browse the repository at this point in the history
  • Loading branch information
steventkrawczyk committed Jul 6, 2023
1 parent c3acc3d commit 99c8458
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/post-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
python setup.py develop
- name: Run tests
run: |
DEBUG=1 HEGELAI_API_KEY=1 python examples/prompttests/example.py
DEBUG=1 python examples/prompttests/example.py
2 changes: 1 addition & 1 deletion prompttools/experiment/openai_chat_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from prompttools.mock.mock import mock_chat_completion_fn
from prompttools.experiment.experiment import Experiment
from hegel.scribe import HegelScribe


class OpenAIChatExperiment(Experiment):
Expand Down Expand Up @@ -54,6 +53,7 @@ def __init__(
):
self.use_scribe = use_scribe
if use_scribe:
from hegel.scribe import HegelScribe
self.completion_fn = HegelScribe(
name=scribe_name, completion_fn=openai.ChatCompletion.create
)
Expand Down
2 changes: 1 addition & 1 deletion prompttools/experiment/openai_completion_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from prompttools.mock.mock import mock_completion_fn
from prompttools.experiment.experiment import Experiment
from hegel.scribe import HegelScribe


class OpenAICompletionExperiment(Experiment):
Expand Down Expand Up @@ -61,6 +60,7 @@ def __init__(
):
self.use_scribe = use_scribe
if use_scribe:
from hegel.scribe import HegelScribe
self.completion_fn = HegelScribe(
name=scribe_name, completion_fn=openai.Completion.create
)
Expand Down

0 comments on commit 99c8458

Please sign in to comment.