Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
| 1 |
import requests
|
| 2 |
import gradio as gr
|
|
|
|
| 3 |
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
def moderation(input_text,api_key='sk-proj-KMeL7IIELJPekicYQOYmT3BlbkFJT8CBEbRL5h3OBExmCMHx'):
|
| 7 |
headers = {
|
| 8 |
"Content-Type": "application/json",
|
| 9 |
"Authorization": f"Bearer {api_key}"
|
|
|
|
| 1 |
import requests
|
| 2 |
import gradio as gr
|
| 3 |
+
import os
|
| 4 |
|
| 5 |
+
openai_api_key = os.environ.get('openai_api_key')
|
| 6 |
|
| 7 |
+
def moderation(input_text,api_key=openai_api_key):
|
|
|
|
| 8 |
headers = {
|
| 9 |
"Content-Type": "application/json",
|
| 10 |
"Authorization": f"Bearer {api_key}"
|