lg3394 commited on
Commit
52dd252
·
verified ·
1 Parent(s): 6639027

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -1,10 +1,8 @@
1
  import gradio as gr
2
  import openai
3
- from huggingface_hub import hf_api
4
 
5
- api_key = hf_api.get_secret("openaiapikey") # Make sure the secret name matches
6
-
7
- openai.api_key = api_key
8
 
9
  def moderate_text(text):
10
  text = str(text).strip() if text else ""
@@ -37,4 +35,4 @@ iface = gr.Interface(
37
  )
38
 
39
  if __name__ == "__main__":
40
- iface.launch()
 
1
  import gradio as gr
2
  import openai
3
+ import os
4
 
5
+ openai.api_key = os.getenv("openaiapikey")
 
 
6
 
7
  def moderate_text(text):
8
  text = str(text).strip() if text else ""
 
35
  )
36
 
37
  if __name__ == "__main__":
38
+ iface.launch()