Terrence-Ubuntu commited on
Commit
ebc0285
·
1 Parent(s): a1e7e96

Hugging Space 2

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -1,10 +1,11 @@
1
  import gradio as gr
2
- import os
3
- from openai import OpenAI
4
- from dotenv import load_dotenv
5
 
6
- load_dotenv()
7
- api_key = os.getenv("OPENAI_API_KEY")
 
 
 
8
  client = OpenAI(api_key=api_key)
9
 
10
  # Initialize an empty history list
 
1
  import gradio as gr
2
+ import json
 
 
3
 
4
+ # Load the config file
5
+ with open('config.json') as f:
6
+ config = json.load(f)
7
+
8
+ api_key = config["OPENAI_API_KEY"]
9
  client = OpenAI(api_key=api_key)
10
 
11
  # Initialize an empty history list