Weijia Shi commited on
Commit
825a5e8
·
1 Parent(s): 72fc934
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -19,9 +19,9 @@ def calculatePerplexity_gpt3(prompt):
19
  temperature=1.0,
20
  logprobs=5,
21
  echo=True)
22
- except openai.InvalidRequestError:
23
- print(openai.InvalidRequestError)
24
- openai.InvalidRequestError, [], 0
25
 
26
  data = responses["choices"][0]["logprobs"]
27
  all_prob = [d for d in data["token_logprobs"] if d is not None]
 
19
  temperature=1.0,
20
  logprobs=5,
21
  echo=True)
22
+ except openai.APIError:
23
+ print(openai.APIError)
24
+ openai.APIError, [], 0
25
 
26
  data = responses["choices"][0]["logprobs"]
27
  all_prob = [d for d in data["token_logprobs"] if d is not None]