Skip to content

Commit

Permalink
Update aws_lm.py
Browse files Browse the repository at this point in the history
  • Loading branch information
okhat authored Feb 4, 2024
1 parent b78b922 commit fad872d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions dsp/modules/aws_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
import json
from dsp.modules.lm import LM

try:
import boto3
except ImportError as e:
raise ImportError(
"You need to install boto3 and update AWS CLI with your AWS credentials."
"Please use the command: pip install boto3"
)

# Heuristic translating number of chars to tokens
# ~4 chars = 1 token
CHARS2TOKENS: int = 4
Expand Down Expand Up @@ -54,6 +46,9 @@ def __init__(
self._max_new_tokens: int = max_new_tokens
self._model_name: str = model
self._truncate_long_prompt_prompts: bool = truncate_long_prompts

import boto3

self.predictor = boto3.client(service_name, region_name=region_name)

@abstractmethod
Expand Down

0 comments on commit fad872d

Please sign in to comment.