Curranj commited on
Commit
ba12037
·
1 Parent(s): 94354f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -74,16 +74,17 @@ def context_gpt_response(question):
74
 
75
  prep = f"This is an OpenAI model tuned to answer questions specific to the Qualia Research institute, a research institute that focuses on consciousness. Here is some question-specific context, and then the Question to answer, related to consciousness, the human experience, and phenomenology: {context}. Here is a question specific to QRI and consciousness in general Q: {question} A: "
76
  # Generate an answer
77
- response = openai.Completion.create(
78
- engine="gpt-4",
79
- prompt=prep,
80
- temperature=0.7,
81
- max_tokens=220,
 
82
  )
83
 
84
 
85
  # Return the answer
86
- return response['choices'][0]['text']
87
 
88
  import gradio as gr
89
 
 
74
 
75
  prep = f"This is an OpenAI model tuned to answer questions specific to the Qualia Research institute, a research institute that focuses on consciousness. Here is some question-specific context, and then the Question to answer, related to consciousness, the human experience, and phenomenology: {context}. Here is a question specific to QRI and consciousness in general Q: {question} A: "
76
  # Generate an answer
77
+ response = openai.ChatCompletion.create(
78
+ model="gpt-4",
79
+ messages=[
80
+ {"role": "system", "content": "You are a helpful assistant."},
81
+ {"role": "user", "content": prep},
82
+ ]
83
  )
84
 
85
 
86
  # Return the answer
87
+ return response['choices'][0]['message']['content']
88
 
89
  import gradio as gr
90