Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import openai
|
| 2 |
import gradio as gr
|
|
|
|
| 3 |
|
| 4 |
STARTING_PROMPT = [{"role": "user", "content": """You are a math question generator. For each question, I will provide you with 4 things:
|
| 5 |
1. the main topic to be tested, 2. the types of question type, 3. the difficulty level, and 4. the required skillsets to solve the question.
|
|
@@ -18,8 +19,7 @@ STARTING_PROMPT = [{"role": "user", "content": """You are a math question genera
|
|
| 18 |
4. Final answer(s): ..."""},
|
| 19 |
{"role": "assistant", "content": f"OK"}]
|
| 20 |
|
| 21 |
-
|
| 22 |
-
openai.api_key = API_KEY
|
| 23 |
|
| 24 |
|
| 25 |
def predict(input, msg_history=STARTING_PROMPT):
|
|
|
|
| 1 |
import openai
|
| 2 |
import gradio as gr
|
| 3 |
+
import os
|
| 4 |
|
| 5 |
STARTING_PROMPT = [{"role": "user", "content": """You are a math question generator. For each question, I will provide you with 4 things:
|
| 6 |
1. the main topic to be tested, 2. the types of question type, 3. the difficulty level, and 4. the required skillsets to solve the question.
|
|
|
|
| 19 |
4. Final answer(s): ..."""},
|
| 20 |
{"role": "assistant", "content": f"OK"}]
|
| 21 |
|
| 22 |
+
openai.api_key = os.environ['OPENAI']
|
|
|
|
| 23 |
|
| 24 |
|
| 25 |
def predict(input, msg_history=STARTING_PROMPT):
|