Jin Ziqi commited on
Commit
d42b071
1 Parent(s): 0303c30

update the interface

Browse files
Files changed (1) hide show
  1. app.py +8 -14
app.py CHANGED
@@ -22,21 +22,15 @@ openai.api_key = os.getenv("api_key")
22
 
23
  def greet(question):
24
  input = question + '\n\n' + "|step|subquestion|process|result|"
25
- while True:
26
- try:
27
- response = openai.ChatCompletion.create(
28
- model="gpt-3.5-turbo",
29
- messages=[
30
- {"role": "system", "content": "You are a helpful assistant that generate table to solve reasoning problem."},
31
- {"role": "user", "content": input},
32
 
33
- ]
34
- )
35
- response = response["choices"][0]["message"]["content"]
36
- except:
37
- print("Unexpected error:", sys.exc_info()[0])
38
- time.sleep(5)
39
- continue
40
  return "|step|subquestion|process|result|\n" + response
41
 
42
 
 
22
 
23
  def greet(question):
24
  input = question + '\n\n' + "|step|subquestion|process|result|"
25
+ response = openai.ChatCompletion.create(
26
+ model="gpt-3.5-turbo",
27
+ messages=[
28
+ {"role": "system", "content": "You are a helpful assistant that generate table to solve reasoning problem."},
29
+ {"role": "user", "content": input},
 
 
30
 
31
+ ]
32
+ )
33
+ response = response["choices"][0]["message"]["content"]
 
 
 
 
34
  return "|step|subquestion|process|result|\n" + response
35
 
36