Skip to content

Commit aa5c77e

Browse files
Merge pull request #2 from seanpedrick-case/dev
Removed obligatory bedrock load in from app
2 parents a1ae0af + 843932c commit aa5c77e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

chatfuncs/chatfuncs.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
from chatfuncs.prompts import instruction_prompt_template_alpaca, instruction_prompt_mistral_orca, instruction_prompt_phi3, instruction_prompt_llama3, instruction_prompt_qwen, instruction_prompt_template_orca, instruction_prompt_gemma
3636
from chatfuncs.model_load import temperature, max_new_tokens, sample, repetition_penalty, top_p, top_k, torch_device, CtransGenGenerationConfig, max_tokens
37-
from chatfuncs.config import GEMINI_API_KEY, AWS_DEFAULT_REGION, LARGE_MODEL_NAME, SMALL_MODEL_NAME
37+
from chatfuncs.config import GEMINI_API_KEY, AWS_DEFAULT_REGION, LARGE_MODEL_NAME, SMALL_MODEL_NAME, RUN_AWS_FUNCTIONS
3838

3939
model_object = [] # Define empty list for model functions to run
4040
tokenizer = [] # Define empty list for model functions to run
@@ -45,7 +45,10 @@ def __init__(self, text, usage_metadata):
4545
self.text = text
4646
self.usage_metadata = usage_metadata
4747

48-
bedrock_runtime = boto3.client('bedrock-runtime', region_name=AWS_DEFAULT_REGION)
48+
if RUN_AWS_FUNCTIONS=="1":
49+
bedrock_runtime = boto3.client('bedrock-runtime', region_name=AWS_DEFAULT_REGION)
50+
else:
51+
bedrock_runtime = ""
4952

5053
torch.cuda.empty_cache()
5154

0 commit comments

Comments
 (0)