jadend commited on
Commit
e5e1c88
·
1 Parent(s): f6eb5de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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.environ["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,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 = client.chat.completions.create(
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,