mlo0ollm commited on
Commit
df4706b
·
1 Parent(s): ca81244
Files changed (1) hide show
  1. gpt_based_function.py +4 -2
gpt_based_function.py CHANGED
@@ -1,7 +1,9 @@
1
  import ast
2
- import openai
3
  from text_annotator import generate_annotated_text
4
 
 
 
5
  def gpt_summary_generator(user_text):
6
  '''
7
  :param user_text:
@@ -10,7 +12,7 @@ def gpt_summary_generator(user_text):
10
  task_description_fs = "Summarize the text in 500 characters in Korean."
11
  user_prompt = f"{user_text}"
12
  messages = [{"role": "system", "content": task_description_fs}, {"role": "user", "content": user_prompt}]
13
- response = openai.ChatCompletion.create(
14
  model="gpt-3.5-turbo-0125",
15
  messages=messages,
16
  temperature=0.06,
 
1
  import ast
2
+ from openai import OpenAI
3
  from text_annotator import generate_annotated_text
4
 
5
+ client = OpenAI()
6
+
7
  def gpt_summary_generator(user_text):
8
  '''
9
  :param user_text:
 
12
  task_description_fs = "Summarize the text in 500 characters in Korean."
13
  user_prompt = f"{user_text}"
14
  messages = [{"role": "system", "content": task_description_fs}, {"role": "user", "content": user_prompt}]
15
+ response = client.chat.completions.create(
16
  model="gpt-3.5-turbo-0125",
17
  messages=messages,
18
  temperature=0.06,