Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
# instruction 문자열 포매팅
|
31 |
-
instruction_text = instructions.highschool_instruction.format(
|
32 |
-
subjects=subjects_str,
|
33 |
-
major=major
|
34 |
-
)
|
35 |
else:
|
36 |
-
|
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=[
|