Spaces:
Sleeping
Sleeping
ivanovot
commited on
Commit
·
c190ab9
1
Parent(s):
fa3c3a0
fix
Browse files- .gradio/flagged/dataset1.csv +2 -0
- app.py +15 -15
.gradio/flagged/dataset1.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
Какой вы школьный предмет?/What school subject are you?,"Если бы вы были растением, то каким?/If you were a plant, what would you be?",Какой вы инструмент из коробки с инструментами?/What tool from the toolbox are you?,Что вкуснее: круг или квадрат?/What tastes better: a circle or a square?,"Если бы вы были кнопкой, что бы вы включали?/If you were a button, what would you turn on?",Ваше любимое число?/What is your favorite number?,Чем вы хотите быть в следующей жизни?/What do you want to be in your next life?,Какой вы вид отдыха?/What type of relaxation are you?,Какой вы звук?/What sound are you?,"Если бы вы были игрушкой, то какой?/If you were a toy, what would you be?",output,timestamp
|
2 |
+
math,,,,,,,,,,,2024-11-29 11:40:57.451907
|
app.py
CHANGED
@@ -14,6 +14,7 @@ def ask(question):
|
|
14 |
|
15 |
# Список вопросов
|
16 |
questions = [
|
|
|
17 |
"Какой вы школьный предмет?/What school subject are you?",
|
18 |
"Если бы вы были растением, то каким?/If you were a plant, what would you be?",
|
19 |
"Какой вы инструмент из коробки с инструментами?/What tool from the toolbox are you?",
|
@@ -23,9 +24,10 @@ questions = [
|
|
23 |
"Чем вы хотите быть в следующей жизни?/What do you want to be in your next life?",
|
24 |
"Какой вы вид отдыха?/What type of relaxation are you?",
|
25 |
"Какой вы звук?/What sound are you?",
|
26 |
-
"Если бы вы были игрушкой, то какой?/If you were a toy, what would you be?"
|
27 |
]
|
28 |
|
|
|
29 |
# Функция обработки данных
|
30 |
def analyze_test(*args):
|
31 |
# Создаем словарь ответов
|
@@ -33,20 +35,19 @@ def analyze_test(*args):
|
|
33 |
|
34 |
# Формируем запрос для анализа
|
35 |
prompt = (
|
36 |
-
"
|
37 |
-
"
|
38 |
-
"
|
39 |
-
"
|
40 |
-
"
|
41 |
-
"
|
42 |
-
"
|
43 |
-
"
|
44 |
-
"
|
45 |
-
"Учтите, что ваш ответ будет выведен в виде строки Python, поэтому оформите его соответствующим образом. "
|
46 |
-
f"Вот данные теста: {str(answers)}"
|
47 |
)
|
48 |
result = ask(prompt)
|
49 |
-
|
|
|
50 |
|
51 |
# Создаем интерфейс
|
52 |
inputs = [gr.Textbox(label=question, placeholder="Введите ваш ответ.../Enter your answer...") for question in questions]
|
@@ -56,8 +57,7 @@ interface = gr.Interface(
|
|
56 |
outputs="text",
|
57 |
title="Тест: Кто вы?/Test: Who are you?",
|
58 |
description=(
|
59 |
-
"Отвечайте на вопросы развернуто, чтобы получить более точный
|
60 |
-
"Answer the questions in detail to get a more accurate result."
|
61 |
)
|
62 |
)
|
63 |
|
|
|
14 |
|
15 |
# Список вопросов
|
16 |
questions = [
|
17 |
+
"На каком языке вы хотите получить результат теста?/What language do you want the test result?",
|
18 |
"Какой вы школьный предмет?/What school subject are you?",
|
19 |
"Если бы вы были растением, то каким?/If you were a plant, what would you be?",
|
20 |
"Какой вы инструмент из коробки с инструментами?/What tool from the toolbox are you?",
|
|
|
24 |
"Чем вы хотите быть в следующей жизни?/What do you want to be in your next life?",
|
25 |
"Какой вы вид отдыха?/What type of relaxation are you?",
|
26 |
"Какой вы звук?/What sound are you?",
|
27 |
+
"Если бы вы были игрушкой, то какой?/If you were a toy, what would you be?",
|
28 |
]
|
29 |
|
30 |
+
|
31 |
# Функция обработки данных
|
32 |
def analyze_test(*args):
|
33 |
# Создаем словарь ответов
|
|
|
35 |
|
36 |
# Формируем запрос для анализа
|
37 |
prompt = (
|
38 |
+
"You have completed a unique test that reveals your inner essence. "
|
39 |
+
"Generate your response in the user's language"
|
40 |
+
"Do not propose new questions or answers; focus solely on analyzing the provided data. "
|
41 |
+
"Imagine that I am your guide in this exploration, and together we are trying to uncover who you truly are. "
|
42 |
+
"Analyze the test results, combining them into a cohesive narrative to create a portrait of the user's personality. "
|
43 |
+
"Describe the user's character as if unveiling their hidden archetype, avoiding simple or banal conclusions. "
|
44 |
+
"Do not mention specific answers but draw inspiration from them to craft a compelling narrative about the user. "
|
45 |
+
"The response should be short, engaging, and feel like a vivid character sketch in two to three sentences. "
|
46 |
+
f"Here are the test data: {str(answers)}"
|
|
|
|
|
47 |
)
|
48 |
result = ask(prompt)
|
49 |
+
print(result)
|
50 |
+
return result.replace("```", "")
|
51 |
|
52 |
# Создаем интерфейс
|
53 |
inputs = [gr.Textbox(label=question, placeholder="Введите ваш ответ.../Enter your answer...") for question in questions]
|
|
|
57 |
outputs="text",
|
58 |
title="Тест: Кто вы?/Test: Who are you?",
|
59 |
description=(
|
60 |
+
"Отвечайте на вопросы развернуто, чтобы получить более точный результат/Answer the questions in detail to get a more accurate result"
|
|
|
61 |
)
|
62 |
)
|
63 |
|