Spaces:
Runtime error
Runtime error
Commit
·
001e37c
1
Parent(s):
5885156
debugging
Browse files- app.py +5 -1
- big5_gradio.ipynb +7 -7
app.py
CHANGED
@@ -11,13 +11,17 @@ def correct_score(score, big_5_indicator):
|
|
11 |
5 : 'Openness'
|
12 |
}
|
13 |
if big_5_sign=='+':
|
|
|
|
|
14 |
return [dict1[big_5_num], score]
|
15 |
elif big_5_sign =='-':
|
|
|
|
|
16 |
return [dict1[big_5_num], 6-score]
|
17 |
# correct_score(3, big_5_indicator='-2')
|
18 |
|
19 |
def make_question(q):
|
20 |
-
q = gr.Radio(choices=[1, 2, 3, 4, 5], label=q) #, value=5
|
21 |
return q
|
22 |
|
23 |
def calculate_personality_score(questions, list_questions):
|
|
|
11 |
5 : 'Openness'
|
12 |
}
|
13 |
if big_5_sign=='+':
|
14 |
+
print(dict1[big_5_num])
|
15 |
+
print(score)
|
16 |
return [dict1[big_5_num], score]
|
17 |
elif big_5_sign =='-':
|
18 |
+
print(dict1[big_5_num])
|
19 |
+
print(score)
|
20 |
return [dict1[big_5_num], 6-score]
|
21 |
# correct_score(3, big_5_indicator='-2')
|
22 |
|
23 |
def make_question(q):
|
24 |
+
q = gr.Radio(choices=[1, 2, 3, 4, 5], label=q, value=3) #, value=5
|
25 |
return q
|
26 |
|
27 |
def calculate_personality_score(questions, list_questions):
|
big5_gradio.ipynb
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
},
|
17 |
{
|
18 |
"cell_type": "code",
|
19 |
-
"execution_count":
|
20 |
"metadata": {},
|
21 |
"outputs": [],
|
22 |
"source": [
|
@@ -39,7 +39,7 @@
|
|
39 |
"# correct_score(3, big_5_indicator='-2')\n",
|
40 |
"\n",
|
41 |
"def make_question(q):\n",
|
42 |
-
" q = gr.Radio(choices=[1, 2, 3, 4, 5], label=q) #, value=5\n",
|
43 |
" return q\n",
|
44 |
"\n",
|
45 |
"def calculate_personality_score(questions, list_questions):\n",
|
@@ -59,14 +59,14 @@
|
|
59 |
},
|
60 |
{
|
61 |
"cell_type": "code",
|
62 |
-
"execution_count":
|
63 |
"metadata": {},
|
64 |
"outputs": [
|
65 |
{
|
66 |
"name": "stdout",
|
67 |
"output_type": "stream",
|
68 |
"text": [
|
69 |
-
"Running on local URL: http://127.0.0.1:
|
70 |
"\n",
|
71 |
"To create a public link, set `share=True` in `launch()`.\n"
|
72 |
]
|
@@ -74,7 +74,7 @@
|
|
74 |
{
|
75 |
"data": {
|
76 |
"text/html": [
|
77 |
-
"<div><iframe src=\"http://127.0.0.1:
|
78 |
],
|
79 |
"text/plain": [
|
80 |
"<IPython.core.display.HTML object>"
|
@@ -86,10 +86,10 @@
|
|
86 |
{
|
87 |
"data": {
|
88 |
"text/plain": [
|
89 |
-
"(<gradio.routes.App at
|
90 |
]
|
91 |
},
|
92 |
-
"execution_count":
|
93 |
"metadata": {},
|
94 |
"output_type": "execute_result"
|
95 |
}
|
|
|
16 |
},
|
17 |
{
|
18 |
"cell_type": "code",
|
19 |
+
"execution_count": 3,
|
20 |
"metadata": {},
|
21 |
"outputs": [],
|
22 |
"source": [
|
|
|
39 |
"# correct_score(3, big_5_indicator='-2')\n",
|
40 |
"\n",
|
41 |
"def make_question(q):\n",
|
42 |
+
" q = gr.Radio(choices=[1, 2, 3, 4, 5], label=q, value=1) #, value=5\n",
|
43 |
" return q\n",
|
44 |
"\n",
|
45 |
"def calculate_personality_score(questions, list_questions):\n",
|
|
|
59 |
},
|
60 |
{
|
61 |
"cell_type": "code",
|
62 |
+
"execution_count": 4,
|
63 |
"metadata": {},
|
64 |
"outputs": [
|
65 |
{
|
66 |
"name": "stdout",
|
67 |
"output_type": "stream",
|
68 |
"text": [
|
69 |
+
"Running on local URL: http://127.0.0.1:7861\n",
|
70 |
"\n",
|
71 |
"To create a public link, set `share=True` in `launch()`.\n"
|
72 |
]
|
|
|
74 |
{
|
75 |
"data": {
|
76 |
"text/html": [
|
77 |
+
"<div><iframe src=\"http://127.0.0.1:7861/\" width=\"900\" height=\"500\" allow=\"autoplay; camera; microphone;\" frameborder=\"0\" allowfullscreen></iframe></div>"
|
78 |
],
|
79 |
"text/plain": [
|
80 |
"<IPython.core.display.HTML object>"
|
|
|
86 |
{
|
87 |
"data": {
|
88 |
"text/plain": [
|
89 |
+
"(<gradio.routes.App at 0x20208ada0d0>, 'http://127.0.0.1:7861/', None)"
|
90 |
]
|
91 |
},
|
92 |
+
"execution_count": 4,
|
93 |
"metadata": {},
|
94 |
"output_type": "execute_result"
|
95 |
}
|