Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
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):
|