Spaces:
Build error
Build error
Commit ·
57dc73d
1
Parent(s): 643e638
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import gradio as gr
|
|
| 6 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 7 |
|
| 8 |
# Set up the GPT-3 model
|
| 9 |
-
model_engine = "gpt-3.5-turbo
|
| 10 |
prompt = (
|
| 11 |
"I want you to act as a math teacher. I will provide some mathematical equations or concepts, "
|
| 12 |
"and it will be your job to explain them in easy-to-understand terms. This could include providing "
|
|
@@ -34,7 +34,7 @@ def generate_response(prompt):
|
|
| 34 |
|
| 35 |
return response.choices[0].text.strip()
|
| 36 |
|
| 37 |
-
# Set up the Gradio interface
|
| 38 |
io = gr.Interface(
|
| 39 |
generate_response,
|
| 40 |
"textbox",
|
|
@@ -42,6 +42,7 @@ io = gr.Interface(
|
|
| 42 |
title="Chat with a Math Teacher",
|
| 43 |
description="Type a math question or concept that you need help understanding, and the math teacher will explain it to you in easy-to-understand terms!",
|
| 44 |
article="This app uses the GPT-3 language model to generate responses. The math teacher is programmed to provide step-by-step instructions for solving a problem, demonstrate various techniques with visuals, or suggest online resources for further study. Please keep in mind that this is an AI language model and may not always provide accurate or complete information.",
|
|
|
|
| 45 |
)
|
| 46 |
|
| 47 |
# Launch the interface
|
|
|
|
| 6 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 7 |
|
| 8 |
# Set up the GPT-3 model
|
| 9 |
+
model_engine = "gpt-3.5-turbo"
|
| 10 |
prompt = (
|
| 11 |
"I want you to act as a math teacher. I will provide some mathematical equations or concepts, "
|
| 12 |
"and it will be your job to explain them in easy-to-understand terms. This could include providing "
|
|
|
|
| 34 |
|
| 35 |
return response.choices[0].text.strip()
|
| 36 |
|
| 37 |
+
# Set up the Gradio interface with debug mode enabled
|
| 38 |
io = gr.Interface(
|
| 39 |
generate_response,
|
| 40 |
"textbox",
|
|
|
|
| 42 |
title="Chat with a Math Teacher",
|
| 43 |
description="Type a math question or concept that you need help understanding, and the math teacher will explain it to you in easy-to-understand terms!",
|
| 44 |
article="This app uses the GPT-3 language model to generate responses. The math teacher is programmed to provide step-by-step instructions for solving a problem, demonstrate various techniques with visuals, or suggest online resources for further study. Please keep in mind that this is an AI language model and may not always provide accurate or complete information.",
|
| 45 |
+
debug=True
|
| 46 |
)
|
| 47 |
|
| 48 |
# Launch the interface
|