Fluospark128 commited on
Commit
830b23d
·
verified ·
1 Parent(s): ad19f16

Update requirements.txt

Browse files
Files changed (1) hide show
  1. requirements.txt +8 -53
requirements.txt CHANGED
@@ -1,55 +1,10 @@
1
  huggingface_hub==0.25.2
2
 
3
-
4
- # app.py
5
- import gradio as gr
6
- from eeg_model import simulate_eeg_data, predict_mental_state
7
- from generative_model import generate_response
8
- from audio_utils import record_audio
9
- from tts_utils import nigerian_accent_tts
10
- from conversation_memory import ConversationMemory
11
-
12
- memory = ConversationMemory()
13
-
14
- # Logic
15
- def chat(user_text=None, record_audio_flag=False):
16
- if record_audio_flag:
17
- user_text = record_audio()
18
-
19
- if not user_text:
20
- return "No input detected.", None
21
-
22
- # 1. Predict mental state
23
- eeg_features = simulate_eeg_data()
24
- mental_state = predict_mental_state(eeg_features)
25
-
26
- # 2. Generate response with memory
27
- history = memory.get_formatted_history()
28
- ai_response = generate_response(mental_state, user_text, history)
29
-
30
- # 3. Update memory
31
- memory.add_exchange(user_input=user_text, bot_response=ai_response)
32
-
33
- # 4. Nigerian Accent TTS
34
- nigerian_accent_tts(ai_response, mental_state)
35
-
36
- return ai_response, "response.mp3"
37
-
38
- # Gradio app
39
- with gr.Blocks() as demo:
40
- gr.Markdown("# EEG Mental State Chatbot with Nigerian Voice (Upgraded)")
41
-
42
- with gr.Row():
43
- user_input = gr.Textbox(label="Type your message")
44
- record_audio_flag = gr.Checkbox(label="Use Microphone?", value=False)
45
-
46
- with gr.Row():
47
- submit_btn = gr.Button("Send")
48
-
49
- with gr.Row():
50
- chatbot_response = gr.Textbox(label="Chatbot response")
51
- chatbot_audio = gr.Audio(label="Chatbot voice", type="filepath")
52
-
53
- submit_btn.click(chat, inputs=[user_input, record_audio_flag], outputs=[chatbot_response, chatbot_audio])
54
-
55
- demo.launch()
 
1
  huggingface_hub==0.25.2
2
 
3
+ gradio
4
+ speechrecognition
5
+ pyaudio
6
+ gtts
7
+ playsound
8
+ joblib
9
+ scikit-learn
10
+ transformers