Spaces:
Running
Running
Update app.py
Browse files
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.
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
82 |
)
|
83 |
|
84 |
|
85 |
# Return the answer
|
86 |
-
return response['choices'][0]['
|
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 |
|