Skip to content

Commit

Permalink
Exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
SrGonao committed Nov 19, 2024
1 parent 903a86f commit 3659ff3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sae_auto_interp/scorers/classifier/classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ async def _generate(
if self.log_prob:
self.generation_kwargs["logprobs"] = True
self.generation_kwargs["top_logprobs"] = 5
response = await self.client.generate(prompt, **self.generation_kwargs)
try:
response = await self.client.generate(prompt, **self.generation_kwargs)
except Exception as e:
logger.error(f"Error generating text: {e}")
response = None
if response is None:
array = [-1] * self.batch_size
probabilities = [-1] * self.batch_size
Expand Down

0 comments on commit 3659ff3

Please sign in to comment.