From 4c5e472636557c9a1c1746f64e80eac50dc78f91 Mon Sep 17 00:00:00 2001 From: Rashmika Reddy Vookanti Date: Fri, 15 Dec 2023 10:08:46 -0800 Subject: [PATCH] Update main.py --- src/autora/doc/pipelines/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/autora/doc/pipelines/main.py b/src/autora/doc/pipelines/main.py index 2c077b2..984b81a 100644 --- a/src/autora/doc/pipelines/main.py +++ b/src/autora/doc/pipelines/main.py @@ -1,13 +1,14 @@ import itertools import logging -import nltk + from timeit import default_timer as timer from typing import List -from nltk.translate.bleu_score import corpus_bleu, SmoothingFunction -from nltk.translate.meteor_score import single_meteor_score +import nltk import torch import typer +from nltk.translate.bleu_score import corpus_bleu, SmoothingFunction +from nltk.translate.meteor_score import single_meteor_score from autora.doc.runtime.predict_hf import Predictor from autora.doc.runtime.prompts import INSTR, SYS, InstructionPrompts, SystemPrompts @@ -20,7 +21,7 @@ logger = logging.getLogger(__name__) nltk.download('wordnet') -def evaluate_documentation(predictions, references): +def evaluate_documentation(predictions, references) -> None: # Tokenize predictions and references tokenized_predictions = [pred[0].split() if pred else [] for pred in predictions] tokenized_references = [[ref.split()] for ref in references]