aliceblue11 commited on
Commit
fc80e7c
·
verified ·
1 Parent(s): 69d0bc7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -39
app.py CHANGED
@@ -1,9 +1,3 @@
1
- 이코드를 적용하라
2
- 한국어로 답하라
3
-
4
- 아래 코드를 (OOOOO 자세한 설명)개선하려고한다. 코드를 생성하라
5
- 요청한 사항외 절대 다른 코드는 수정하지마라
6
-
7
  import gradio as gr
8
 
9
  # 질문 설정 (총 20개로 축소)
@@ -54,7 +48,7 @@ mbti_details = {
54
  "나쁜": "감정적으로 충돌하고, 세부 사항을 무시하는 경향이 문제를 일으킬 수 있음."
55
  }
56
  },
57
- # 다른 MBTI 유형 설명 추가
58
  }
59
 
60
  # MBTI 결과에 따른 설명 제공 함수
@@ -72,7 +66,7 @@ def get_mbti_details(mbti_type):
72
  return "알 수 없는 MBTI 유형입니다."
73
 
74
  # 결과 계산 함수
75
- def calculate_mbti(responses):
76
  # 각 성향 점수 계산
77
  score_mapping = {
78
  "매우 아니다": 1,
@@ -116,34 +110,3 @@ def create_interface():
116
  # 인터페이스 실행
117
  interface = create_interface()
118
  interface.launch()
119
-
120
-
121
-
122
-
123
- ===== Application Startup at 2024-08-22 10:52:55 =====
124
-
125
- /usr/local/lib/python3.10/site-packages/gradio/utils.py:1002: UserWarning: Expected 1 arguments for function <function calculate_mbti at 0x7f1d47a79510>, received 20.
126
- warnings.warn(
127
- /usr/local/lib/python3.10/site-packages/gradio/utils.py:1010: UserWarning: Expected maximum 1 arguments for function <function calculate_mbti at 0x7f1d47a79510>, received 20.
128
- warnings.warn(
129
- Running on local URL: http://0.0.0.0:7860
130
-
131
- To create a public link, set `share=True` in `launch()`.
132
- Traceback (most recent call last):
133
- File "/usr/local/lib/python3.10/site-packages/gradio/queueing.py", line 536, in process_events
134
- response = await route_utils.call_process_api(
135
- File "/usr/local/lib/python3.10/site-packages/gradio/route_utils.py", line 288, in call_process_api
136
- output = await app.get_blocks().process_api(
137
- File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1931, in process_api
138
- result = await self.call_function(
139
- File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1516, in call_function
140
- prediction = await anyio.to_thread.run_sync( # type: ignore
141
- File "/usr/local/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
142
- return await get_async_backend().run_sync_in_worker_thread(
143
- File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
144
- return await future
145
- File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 859, in run
146
- result = context.run(func, *args)
147
- File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 826, in wrapper
148
- response = f(*args, **kwargs)
149
- TypeError: calculate_mbti() takes 1 positional argument but 20 were given
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
  # 질문 설정 (총 20개로 축소)
 
48
  "나쁜": "감정적으로 충돌하고, 세부 사항을 무시하는 경향이 문제를 일으킬 수 있음."
49
  }
50
  },
51
+ # 다른 MBTI 유형 설명 추가 가능
52
  }
53
 
54
  # MBTI 결과에 따른 설명 제공 함수
 
66
  return "알 수 없는 MBTI 유형입니다."
67
 
68
  # 결과 계산 함수
69
+ def calculate_mbti(*responses): # 리스트 형태로 모든 응답을 받는다
70
  # 각 성향 점수 계산
71
  score_mapping = {
72
  "매우 아니다": 1,
 
110
  # 인터페이스 실행
111
  interface = create_interface()
112
  interface.launch()