Spaces:
Runtime error
Runtime error
Commit
·
e5ecad3
1
Parent(s):
456ff8c
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,6 +41,11 @@ def generate_code(input_text):
|
|
| 41 |
corrected_code = correct_code(input_text)
|
| 42 |
return corrected_code
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
interface = gr.Interface(fn=generate_code, inputs=input_text, outputs=output_text, title="AI Code Assistant", description="Enter your code and click submit to generate a corrected version.")
|
| 45 |
|
| 46 |
# Run the Gradio interface
|
|
|
|
| 41 |
corrected_code = correct_code(input_text)
|
| 42 |
return corrected_code
|
| 43 |
|
| 44 |
+
# Set up the OpenAI API credentials
|
| 45 |
+
secrets.OPENAI_API_KEY = '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'
|
| 46 |
+
openai.api_key = secrets.OPENAI_API_KEY
|
| 47 |
+
|
| 48 |
+
# Define the Gradio interface
|
| 49 |
interface = gr.Interface(fn=generate_code, inputs=input_text, outputs=output_text, title="AI Code Assistant", description="Enter your code and click submit to generate a corrected version.")
|
| 50 |
|
| 51 |
# Run the Gradio interface
|