PeterPinetree commited on
Commit
8bb1d1f
Β·
verified Β·
1 Parent(s): 0c5c4d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +129 -22
app.py CHANGED
@@ -8,7 +8,6 @@ from transformers import (
8
  AutoModelForSpeechSeq2Seq,
9
  AutoProcessor
10
  )
11
- import speech_recognition as sr
12
  import streamlit.components.v1 as components
13
 
14
  # Avatar Personas (same as previous implementation)
@@ -16,38 +15,146 @@ AVATAR_PERSONAS = {
16
  "Rat": {
17
  "image": "rat.png",
18
  "name": "Puzzle Master Rat",
19
- "description": """
20
- 🧩 Clever and curious, I turn language learning into an exciting puzzle!
21
- I love breaking down complex ideas into fun, logical challenges.
22
- My teaching style is all about critical thinking and playful problem-solving.
23
- """,
24
  "teaching_style": "Analytical and game-based learning",
25
- "sample_phrase": "Let's solve this English mystery together!",
26
- "voice_sample": "I love solving word puzzles and learning new things!"
 
 
 
27
  },
28
  "Ox": {
29
  "image": "ox.png",
30
  "name": "Professor Ox",
31
- "description": """
32
- πŸ“š Patient and methodical, I guide you through English step by step.
33
- I break down grammar and vocabulary into clear, manageable segments.
34
- Learning is a journey, and I'll be your steady companion.
35
- """,
36
  "teaching_style": "Structured and systematic approach",
37
- "sample_phrase": "Let's learn English systematically!",
38
- "voice_sample": "English learning is about understanding each concept carefully."
 
 
 
39
  },
40
  "Tiger": {
41
  "image": "tiger.png",
42
  "name": "Adventure Coach Tiger",
43
- "description": """
44
- πŸ† Energetic and brave, I make English learning an exciting adventure!
45
- I turn every lesson into a challenge, motivating you to push your limits
46
- and discover the joy of language learning.
47
- """,
48
  "teaching_style": "High-energy and challenge-driven",
49
- "sample_phrase": "Are you ready to level up your English?",
50
- "voice_sample": "Let's make learning English an exciting journey!"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  }
52
  }
53
 
 
8
  AutoModelForSpeechSeq2Seq,
9
  AutoProcessor
10
  )
 
11
  import streamlit.components.v1 as components
12
 
13
  # Avatar Personas (same as previous implementation)
 
15
  "Rat": {
16
  "image": "rat.png",
17
  "name": "Puzzle Master Rat",
18
+ "description": "Clever and resourceful. Loves puzzles and word games.",
19
+ "sample": "Let's solve a riddle together!",
 
 
 
20
  "teaching_style": "Analytical and game-based learning",
21
+ "learning_tips": [
22
+ "Break complex ideas into smaller puzzles",
23
+ "Use word games to learn vocabulary",
24
+ "Think critically about language patterns"
25
+ ]
26
  },
27
  "Ox": {
28
  "image": "ox.png",
29
  "name": "Professor Ox",
30
+ "description": "Strong and dependable. Very patient when explaining concepts.",
31
+ "sample": "I will guide you step by step.",
 
 
 
32
  "teaching_style": "Structured and systematic approach",
33
+ "learning_tips": [
34
+ "Learn grammar rules systematically",
35
+ "Practice one concept at a time",
36
+ "Build a strong foundation"
37
+ ]
38
  },
39
  "Tiger": {
40
  "image": "tiger.png",
41
  "name": "Adventure Coach Tiger",
42
+ "description": "Brave and energetic. Loves exciting challenges.",
43
+ "sample": "Let's make learning an adventure!",
 
 
 
44
  "teaching_style": "High-energy and challenge-driven",
45
+ "learning_tips": [
46
+ "Turn learning into a fun challenge",
47
+ "Set exciting language goals",
48
+ "Celebrate every bit of progress"
49
+ ]
50
+ },
51
+ "Rabbit": {
52
+ "image": "rabbit.png",
53
+ "name": "Storyteller Rabbit",
54
+ "description": "Gentle and kind. Encourages learning through storytelling.",
55
+ "sample": "I have a story to share with you!",
56
+ "teaching_style": "Narrative and empathetic learning",
57
+ "learning_tips": [
58
+ "Learn through engaging stories",
59
+ "Connect language to emotional experiences",
60
+ "Use imagination to remember vocabulary"
61
+ ]
62
+ },
63
+ "Dragon": {
64
+ "image": "dragon.png",
65
+ "name": "Scholar Dragon",
66
+ "description": "Confident and intelligent. Explains ideas clearly.",
67
+ "sample": "I will help you think like a scholar!",
68
+ "teaching_style": "Intellectual and precise instruction",
69
+ "learning_tips": [
70
+ "Understand the logic behind language rules",
71
+ "Analyze language structures",
72
+ "Develop a scholarly approach to learning"
73
+ ]
74
+ },
75
+ "Snake": {
76
+ "image": "snake.png",
77
+ "name": "Philosopher Snake",
78
+ "description": "Calm and analytical. Gives insightful explanations.",
79
+ "sample": "Let's break this down logically!",
80
+ "teaching_style": "Reflective and analytical learning",
81
+ "learning_tips": [
82
+ "Think deeply about language nuances",
83
+ "Understand the 'why' behind grammar rules",
84
+ "Develop critical thinking in language"
85
+ ]
86
+ },
87
+ "Horse": {
88
+ "image": "horse.png",
89
+ "name": "Energetic Coach Horse",
90
+ "description": "Cheerful and enthusiastic. Encourages active participation.",
91
+ "sample": "Come on, let's say it together!",
92
+ "teaching_style": "Interactive and participatory learning",
93
+ "learning_tips": [
94
+ "Practice speaking out loud",
95
+ "Engage actively in conversations",
96
+ "Build confidence through participation"
97
+ ]
98
+ },
99
+ "Goat": {
100
+ "image": "goat.png",
101
+ "name": "Creative Mentor Goat",
102
+ "description": "Creative and friendly. Uses fun examples.",
103
+ "sample": "Let's use pictures to understand this!",
104
+ "teaching_style": "Visual and creative learning",
105
+ "learning_tips": [
106
+ "Use visual aids to learn vocabulary",
107
+ "Create mental images for new words",
108
+ "Learn through creative and fun methods"
109
+ ]
110
+ },
111
+ "Monkey": {
112
+ "image": "monkey.png",
113
+ "name": "Playful Genius Monkey",
114
+ "description": "Smart and playful. Makes learning fun.",
115
+ "sample": "I love word games! Do you?",
116
+ "teaching_style": "Playful and game-oriented learning",
117
+ "learning_tips": [
118
+ "Turn learning into a fun game",
119
+ "Use humor to remember language",
120
+ "Enjoy the process of learning"
121
+ ]
122
+ },
123
+ "Rooster": {
124
+ "image": "rooster.png",
125
+ "name": "Pronunciation Master Rooster",
126
+ "description": "Confident and vocal. Encourages clear pronunciation.",
127
+ "sample": "Let's practice speaking clearly!",
128
+ "teaching_style": "Phonetic and pronunciation-focused",
129
+ "learning_tips": [
130
+ "Focus on clear pronunciation",
131
+ "Practice accent and intonation",
132
+ "Listen carefully to native speakers"
133
+ ]
134
+ },
135
+ "Dog": {
136
+ "image": "dog.png",
137
+ "name": "Supportive Buddy Dog",
138
+ "description": "Loyal and encouraging. Builds confidence in learners.",
139
+ "sample": "You're doing a great job!",
140
+ "teaching_style": "Supportive and confidence-building",
141
+ "learning_tips": [
142
+ "Believe in your learning abilities",
143
+ "Don't fear making mistakes",
144
+ "Stay motivated and persistent"
145
+ ]
146
+ },
147
+ "Pig": {
148
+ "image": "pig.png",
149
+ "name": "Relaxed Mentor Pig",
150
+ "description": "Easygoing and kind. Makes learning feel natural.",
151
+ "sample": "Let's take it step by step together!",
152
+ "teaching_style": "Relaxed and natural learning",
153
+ "learning_tips": [
154
+ "Learn at your own pace",
155
+ "Stay calm and enjoy the process",
156
+ "Make learning a comfortable experience"
157
+ ]
158
  }
159
  }
160