hanyullai commited on
Commit
5f01803
1 Parent(s): 931fc79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -12,11 +12,12 @@ def predict(text, seed, out_seq_length, min_gen_length, sampling_strategy,
12
  temperature, topk, topp):
13
  global APIKEY
14
  global APISECRET
 
15
  url = 'https://wudao.aminer.cn/os/api/api/v2/completions_130B'
16
 
17
  payload = json.dumps({
18
  "apikey": APIKEY,
19
- "apisecret": APISECRET,
20
  "language": "zh-CN",
21
  "prompt": text,
22
  "length_penalty": length_penalty,
@@ -30,13 +31,12 @@ def predict(text, seed, out_seq_length, min_gen_length, sampling_strategy,
30
  })
31
 
32
  headers = {
33
- 'Content-Type': 'application/json'
34
  }
35
 
36
  response = requests.request("POST", url, headers=headers, data=payload)
37
 
38
- print(response.text)
39
- return ret.text
40
 
41
 
42
  if __name__ == "__main__":
 
12
  temperature, topk, topp):
13
  global APIKEY
14
  global APISECRET
15
+
16
  url = 'https://wudao.aminer.cn/os/api/api/v2/completions_130B'
17
 
18
  payload = json.dumps({
19
  "apikey": APIKEY,
20
+ "apisecret": APISECRET ,
21
  "language": "zh-CN",
22
  "prompt": text,
23
  "length_penalty": length_penalty,
 
31
  })
32
 
33
  headers = {
34
+ 'Content-Type': 'application/json'
35
  }
36
 
37
  response = requests.request("POST", url, headers=headers, data=payload)
38
 
39
+ return response.text
 
40
 
41
 
42
  if __name__ == "__main__":