Skip to content

Commit

Permalink
fix import; resolves #46 (#47)
Browse files Browse the repository at this point in the history
* fix import issues.

* bump version.
  • Loading branch information
lxuechen authored Jun 15, 2023
1 parent 80208d1 commit 1fe814f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/alpaca_farm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.1.4"
__version__ = "0.1.5"
4 changes: 2 additions & 2 deletions src/alpaca_farm/auto_annotations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from .eval import *
from .pairwise_annotators import *
from .eval import alpaca_leaderboard
from .pairwise_annotators import PairwiseAutoAnnotator
10 changes: 4 additions & 6 deletions src/alpaca_farm/auto_annotations/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import datasets
import pandas as pd

from alpaca_farm import constants
from alpaca_farm.auto_annotations import PairwiseAutoAnnotator
from alpaca_farm.auto_annotations.analysis import head2head_to_metrics

from .. import constants
from . import analysis, pairwise_annotators
from . import utils as ann_utils

__all__ = ["alpaca_leaderboard"]
Expand Down Expand Up @@ -133,9 +131,9 @@ def alpaca_leaderboard(
We are computing the metrics on all examples you gave."""
)

annotator = PairwiseAutoAnnotator(annotators_config=annotators_config, **kwargs)
annotator = pairwise_annotators.PairwiseAutoAnnotator(annotators_config=annotators_config, **kwargs)
annotated = annotator.annotate_head2head(outputs_1=outputs_baseline, outputs_2=all_outputs)
all_metrics[name] = head2head_to_metrics(preferences=[a["preference"] for a in annotated])
all_metrics[name] = analysis.head2head_to_metrics(preferences=[a["preference"] for a in annotated])

df_results = pd.DataFrame(all_metrics).T.sort_values(by="win_rate", ascending=False)

Expand Down

0 comments on commit 1fe814f

Please sign in to comment.