minko186 commited on
Commit
088ef38
·
verified ·
1 Parent(s): 2d067ac

Update ai_generate.py

Browse files
Files changed (1) hide show
  1. ai_generate.py +5 -5
ai_generate.py CHANGED
@@ -9,13 +9,13 @@ pipes = {
9
  }
10
 
11
  def generate(text, model, api):
12
- if model is "GPT-Neo":
13
  response = pipes[model](text)
14
  return response[0]
15
- elif model is "Llama 3":
16
  response = pipes[model](text)
17
  return response[0]
18
- elif model is "OpenAI GPT 3.5":
19
  client = OpenAI(
20
  api_key=api,
21
  )
@@ -28,7 +28,7 @@ def generate(text, model, api):
28
  frequency_penalty=0.0
29
  )
30
  return response[0].message.content
31
- elif model is "OpenAI GPT 4":
32
  client = OpenAI(
33
  api_key=api,
34
  )
@@ -41,7 +41,7 @@ def generate(text, model, api):
41
  frequency_penalty=0.0
42
  )
43
  return response[0].message.content
44
- elif model is "OpenAI GPT 4o":
45
  client = OpenAI(
46
  api_key=api,
47
  )
 
9
  }
10
 
11
  def generate(text, model, api):
12
+ if model == "GPT-Neo":
13
  response = pipes[model](text)
14
  return response[0]
15
+ elif model == "Llama 3":
16
  response = pipes[model](text)
17
  return response[0]
18
+ elif model == "OpenAI GPT 3.5":
19
  client = OpenAI(
20
  api_key=api,
21
  )
 
28
  frequency_penalty=0.0
29
  )
30
  return response[0].message.content
31
+ elif model == "OpenAI GPT 4":
32
  client = OpenAI(
33
  api_key=api,
34
  )
 
41
  frequency_penalty=0.0
42
  )
43
  return response[0].message.content
44
+ elif model == "OpenAI GPT 4o":
45
  client = OpenAI(
46
  api_key=api,
47
  )