Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add bedrock client #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

takipipo
Copy link

@takipipo takipipo commented Apr 24, 2024

Feature

  • Add bedrock client

Comment on lines 47 to 51
body = {
"prompt": prompt,
"temperature": 0.5,
"top_p": 0.9,
"max_gen_len": 512,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not sure please confirm

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ถ้าในกรณีที่ไม่ได้ add request_config.sampling_params ตอนรัน command
มันจะถูก set ว่า request_config.sampling_params = {"max_tokens": num_output_tokens}
ref:

if not additional_sampling_params:
additional_sampling_params = {}

default_sampling_params = {"max_tokens": num_output_tokens}
default_sampling_params.update(additional_sampling_params)

metadata = {
"model": model,
"mean_input_tokens": mean_input_tokens,
"stddev_input_tokens": stddev_input_tokens,
"mean_output_tokens": mean_output_tokens,
"stddev_output_tokens": stddev_output_tokens,
"num_concurrent_requests": num_concurrent_requests,
"additional_sampling_params": additional_sampling_params,
}
metadata["results"] = ret
return metadata, completed_requests

soln:
แก้ "max_token" ให้เป็น parameter ที่ใช้บอก "max_token" ในแต่ละ client เช่น sagemaker ใช้ "max_new_tokens"

if "max_tokens" in sampling_params:
sampling_params["max_new_tokens"] = sampling_params["max_tokens"]
del sampling_params["max_tokens"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants