-
Notifications
You must be signed in to change notification settings - Fork 179
/
Copy pathquery.py
50 lines (44 loc) · 1.08 KB
/
query.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import mii
results = []
generator = mii.mii_query_handle("multi_models")
result = generator.query(
{
"query": ["DeepSpeed is",
"Seattle is"],
"deployment_name": "bigscience/bloom-560m_deployment"
},
do_sample=True,
max_new_tokens=30,
)
results.append(result)
print(result)
result = generator.query({
'query':
"DeepSpeed is the greatest",
"deployment_name":
"microsoft/DialogRPT-human-vs-rand_deployment"
})
results.append(result)
print(result)
result = generator.query({
'text': "DeepSpeed is the greatest",
'conversation_id': 3,
'past_user_inputs': [],
'generated_responses': [],
"deployment_name": "microsoft/DialoGPT-large_deployment"
})
results.append(result)
print(result)
result = generator.query({
'question':
"What is the greatest?",
'context':
"DeepSpeed is the greatest",
"deployment_name":
"deepset/roberta-large-squad2" + "-qa-deployment"
})
results.append(result)
print(result)