Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,8 +8,8 @@ import huggingface_hub
|
|
| 8 |
from huggingface_hub import Repository
|
| 9 |
from datetime import datetime
|
| 10 |
|
| 11 |
-
openai.api_key = os.
|
| 12 |
-
client = OpenAI()
|
| 13 |
|
| 14 |
# set up for the Hugging Face dataset, based on the directory you set up
|
| 15 |
DATASET_REPO_URL = "https://huggingface.co/datasets/jadend/mr_bot_requests"
|
|
@@ -45,7 +45,7 @@ user_db = {
|
|
| 45 |
|
| 46 |
# the OpenAI function to use the given prompt to the model defined.
|
| 47 |
def mr_bot(premise, tokens, temperature):
|
| 48 |
-
response =
|
| 49 |
model="gpt-3.5-turbo",
|
| 50 |
messages=[{"role": "user", "content": premise}],
|
| 51 |
max_tokens=tokens,
|
|
|
|
| 8 |
from huggingface_hub import Repository
|
| 9 |
from datetime import datetime
|
| 10 |
|
| 11 |
+
openai.api_key = os.getenv["API_TOKEN"]
|
| 12 |
+
#client = OpenAI()
|
| 13 |
|
| 14 |
# set up for the Hugging Face dataset, based on the directory you set up
|
| 15 |
DATASET_REPO_URL = "https://huggingface.co/datasets/jadend/mr_bot_requests"
|
|
|
|
| 45 |
|
| 46 |
# the OpenAI function to use the given prompt to the model defined.
|
| 47 |
def mr_bot(premise, tokens, temperature):
|
| 48 |
+
response = openai.ChatCompletions.create(
|
| 49 |
model="gpt-3.5-turbo",
|
| 50 |
messages=[{"role": "user", "content": premise}],
|
| 51 |
max_tokens=tokens,
|