NeuralJunkie commited on
Commit
c57b4a1
·
1 Parent(s): 7476733

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -12
app.py CHANGED
@@ -7,7 +7,7 @@ api_key = os.environ.get("API_KEY", "API_KEY")
7
  openai.api_key = api_key
8
 
9
  # Set up the GPT-3.5-Turbo model
10
- model_engine = "gpt-3.5-turbo-0301"
11
  max_tokens = 1000
12
  temperature = 0.7
13
 
@@ -19,23 +19,12 @@ def chatbot(text):
19
  prompt=text,
20
  max_tokens=max_tokens,
21
  temperature=temperature,
22
- model="text-davinci-002",
23
- chat_history=None,
24
- stop=None,
25
- n=None,
26
- logprobs=None,
27
- echo=False,
28
- presence_penalty=None,
29
- frequency_penalty=None,
30
- best_of=None,
31
- response_format="text"
32
  )
33
  # Extract the generated response from the API response
34
  generated_text = response.choices[0].text
35
  # Return the response, stripping any leading or trailing whitespace
36
  return generated_text.strip()
37
 
38
-
39
  # Define the Gradio interface
40
  interface = gr.Interface(
41
  fn=chatbot,
 
7
  openai.api_key = api_key
8
 
9
  # Set up the GPT-3.5-Turbo model
10
+ model_engine = "gpt-turbo-3.5" # engine parameter used to specify the GPT-3.5-Turbo model
11
  max_tokens = 1000
12
  temperature = 0.7
13
 
 
19
  prompt=text,
20
  max_tokens=max_tokens,
21
  temperature=temperature,
 
 
 
 
 
 
 
 
 
 
22
  )
23
  # Extract the generated response from the API response
24
  generated_text = response.choices[0].text
25
  # Return the response, stripping any leading or trailing whitespace
26
  return generated_text.strip()
27
 
 
28
  # Define the Gradio interface
29
  interface = gr.Interface(
30
  fn=chatbot,