Danil commited on
Commit
86bb3dc
1 Parent(s): bb00968

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -12
app.py CHANGED
@@ -11,19 +11,26 @@ engine = os.environ["engine"]
11
  def happytt(temperature,max_tokens,text,stop):
12
  try:
13
  s = json.loads(stop)
 
 
 
 
 
 
 
 
 
 
14
  except json.JSONDecodeError:
15
- s = []
16
-
17
- response = openai.Completion.create(
18
- engine=engine,
19
- prompt=text,
20
- temperature=temperature,
21
- max_tokens=max_tokens,
22
- top_p=1,
23
- frequency_penalty=0,
24
- presence_penalty=0,
25
- stop=s
26
- )
27
 
28
  return response.choices[0].text
29
 
 
11
  def happytt(temperature,max_tokens,text,stop):
12
  try:
13
  s = json.loads(stop)
14
+ response = openai.Completion.create(
15
+ engine=engine,
16
+ prompt=text,
17
+ temperature=temperature,
18
+ max_tokens=max_tokens,
19
+ top_p=1,
20
+ frequency_penalty=0,
21
+ presence_penalty=0,
22
+ stop=s
23
+ )
24
  except json.JSONDecodeError:
25
+ response = openai.Completion.create(
26
+ engine=engine,
27
+ prompt=text,
28
+ temperature=temperature,
29
+ max_tokens=max_tokens,
30
+ top_p=1,
31
+ frequency_penalty=0,
32
+ presence_penalty=0
33
+ )
 
 
 
34
 
35
  return response.choices[0].text
36