Skip to content

Commit

Permalink
Setting output schema to None for expln (#907)
Browse files Browse the repository at this point in the history
  • Loading branch information
DhruvaBansal00 authored Sep 30, 2024
1 parent d12ccc0 commit 9fa783e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/autolabel/confidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ async def p_true(self, model_generation: LLMAnnotation, **kwargs) -> float:

if self.llm.returns_token_probs():
p_true_prompt = model_generation.prompt + p_true_prompt
response = self.llm.label([p_true_prompt])
response = self.llm.label([p_true_prompt], output_schema=None)
response_logprobs = response.generations[0][0].generation_info["logprobs"][
"top_logprobs"
]
Expand Down
8 changes: 3 additions & 5 deletions src/autolabel/labeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,7 @@ async def arun(
console=self.console,
)
if self.console_output
else tqdm(indices)
if self.use_tqdm
else indices
else tqdm(indices) if self.use_tqdm else indices
):
chunk = dataset.inputs[current_index]
examples = []
Expand Down Expand Up @@ -562,7 +560,7 @@ async def agenerate_explanations(
if col in seed_example and seed_example[col] is not None:
explanation_prompt[col] = seed_example[col]
explanation_prompt = json.dumps(explanation_prompt)
response = await self.llm.label([explanation_prompt])
response = await self.llm.label([explanation_prompt], output_schema=None)
explanation = response.generations[0][0].text
seed_example[explanation_column] = str(explanation) if explanation else ""
if return_annotations:
Expand Down Expand Up @@ -613,7 +611,7 @@ def generate_synthetic_dataset(self) -> AutolabelDataset:
):
prompt = self.task.get_generate_dataset_prompt(label)

result = self.llm.label([prompt])
result = self.llm.label([prompt], output_schema=None)
if result.errors[0] is not None:
self.console.print(
f"Error generating rows for label {label}: {result.errors[0]}"
Expand Down

0 comments on commit 9fa783e

Please sign in to comment.