generated from RedHatQE/python-template-repository
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtgis_grpc.py
26 lines (25 loc) · 1023 Bytes
/
tgis_grpc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
GENERATION_PROTO_FILEPATH: str = "utilities/manifests/text-generation-inference/generation.proto"
TGIS_INFERENCE_CONFIG = {
"default_query_model": {
"query_input": "At what temperature does water boil?",
"query_output": "74 degrees F",
},
"all-tokens": {
"grpc": {
"endpoint": "fmaas.GenerationService/Generate",
"header": "mm-model-id: $model_name",
"body": '{"requests": [{"text":"$query_input"}]}',
"args": f"-proto {GENERATION_PROTO_FILEPATH}",
"response_fields_map": {"response": "responses", "response_output": "text"},
}
},
"streaming": {
"grpc": {
"endpoint": "fmaas.GenerationService/GenerateStream",
"header": "mm-model-id: $model_name",
"body": '{"requests": [{"text":"$query_input"}]}',
"args": f"-proto {GENERATION_PROTO_FILEPATH}",
"response_fields_map": {"response": "responses", "response_output": "text"},
}
},
}