JUNGU commited on
Commit
2293dbc
·
verified ·
1 Parent(s): f6ed87b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -12
app.py CHANGED
@@ -22,19 +22,16 @@ def upload_and_process_file():
22
 
23
  # 생활기록부 문구 생성 함수
24
  def generate_living_record(data, selected_instruction, subjects=None, major=None):
25
- data_str = str(data)
26
-
27
- if selected_instruction == "중·고등학교" and subjects and major:
28
- # 선택된 교과목들을 문자열로 변환
29
- subjects_str = ", ".join(subjects)
30
- # instruction 문자열 포매팅
31
- instruction_text = instructions.highschool_instruction.format(
32
- subjects=subjects_str,
33
- major=major
34
- )
35
  else:
36
- instruction_text = instructions.instruction
37
-
 
 
38
  response = openai.ChatCompletion.create(
39
  model="gpt-4o-mini",
40
  messages=[
 
22
 
23
  # 생활기록부 문구 생성 함수
24
  def generate_living_record(data, selected_instruction, subjects=None, major=None):
25
+ if selected_instruction == "중·고등학교":
26
+ # 교과목과 희망전공 정보를 데이터 시작 부분에 추가
27
+ data_str = f"교과목: {', '.join(subjects) if subjects else ''}\n"
28
+ data_str += f"희망전공: {major if major else ''}\n\n"
29
+ data_str += str(data)
 
 
 
 
 
30
  else:
31
+ data_str = str(data)
32
+
33
+ instruction_text = instructions.highschool_instruction if selected_instruction == "중·고등학교" else instructions.instruction
34
+
35
  response = openai.ChatCompletion.create(
36
  model="gpt-4o-mini",
37
  messages=[