diegocp01 commited on
Commit
5305e57
·
verified ·
1 Parent(s): 0c69584

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -1,9 +1,14 @@
1
  from google.colab import userdata
2
  import openai
 
3
  openai.api_key = userdata.get('OPENAI_API_KEY')
4
  # Initialize the OpenAI client
5
  from openai import OpenAI
6
- client = OpenAI(api_key=openai.api_key)
 
 
 
 
7
  from datetime import datetime
8
  # gpt function
9
  def chatgpt(prompt):
 
1
  from google.colab import userdata
2
  import openai
3
+ import os
4
  openai.api_key = userdata.get('OPENAI_API_KEY')
5
  # Initialize the OpenAI client
6
  from openai import OpenAI
7
+ # HF
8
+ API_KEY = os.getenv("OPENAI_API_KEY")
9
+ client = OpenAI(api_key=API_KEY)
10
+
11
+
12
  from datetime import datetime
13
  # gpt function
14
  def chatgpt(prompt):