Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
model changed to Haiku 3.5 for query re=write
Browse files
utilities/invoke_models.py
CHANGED
|
@@ -58,9 +58,8 @@ def invoke_model_mm(text,img):
|
|
| 58 |
#print(response_body)
|
| 59 |
return response_body.get("embedding")
|
| 60 |
|
| 61 |
-
def invoke_llm_model(input,is_stream,model_id):
|
| 62 |
-
|
| 63 |
-
model_id = "us.anthropic.claude-3-5-haiku-20241022-v1:0"
|
| 64 |
if(is_stream == False):
|
| 65 |
response = bedrock_runtime_client.invoke_model(
|
| 66 |
modelId= model_id,#"us.anthropic.claude-3-5-haiku-20241022-v1:0",#"anthropic.claude-3-5-haiku-20241022-v1:0",#"anthropic.claude-3-5-sonnet-20240620-v1:0",,
|
|
@@ -128,9 +127,8 @@ def read_from_table(file,question):
|
|
| 128 |
agent_res = agent.invoke(question)['output']
|
| 129 |
return agent_res
|
| 130 |
|
| 131 |
-
def generate_image_captions_llm(base64_string,question,model_id):
|
| 132 |
-
|
| 133 |
-
model_id = "us.anthropic.claude-3-5-haiku-20241022-v1:0"
|
| 134 |
|
| 135 |
response = bedrock_runtime_client.invoke_model(
|
| 136 |
modelId= model_id,
|
|
|
|
| 58 |
#print(response_body)
|
| 59 |
return response_body.get("embedding")
|
| 60 |
|
| 61 |
+
def invoke_llm_model(input,is_stream,model_id="us.anthropic.claude-3-5-haiku-20241022-v1:0"):
|
| 62 |
+
|
|
|
|
| 63 |
if(is_stream == False):
|
| 64 |
response = bedrock_runtime_client.invoke_model(
|
| 65 |
modelId= model_id,#"us.anthropic.claude-3-5-haiku-20241022-v1:0",#"anthropic.claude-3-5-haiku-20241022-v1:0",#"anthropic.claude-3-5-sonnet-20240620-v1:0",,
|
|
|
|
| 127 |
agent_res = agent.invoke(question)['output']
|
| 128 |
return agent_res
|
| 129 |
|
| 130 |
+
def generate_image_captions_llm(base64_string,question,model_id="us.anthropic.claude-3-5-haiku-20241022-v1:0"):
|
| 131 |
+
|
|
|
|
| 132 |
|
| 133 |
response = bedrock_runtime_client.invoke_model(
|
| 134 |
modelId= model_id,
|