simonraj commited on
Commit
306781b
·
verified ·
1 Parent(s): cf815ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -4
app.py CHANGED
@@ -1,4 +1,14 @@
1
- # app.py
 
 
 
 
 
 
 
 
 
 
2
  import gradio as gr
3
  import asyncio
4
  import os
@@ -6,16 +16,22 @@ import thinkingframes
6
  import soundfile as sf
7
  import numpy as np
8
  import logging
9
- from openai import OpenAI
10
  from dotenv import load_dotenv
11
  from policy import user_acceptance_policy
12
  from styles import theme
13
- from thinkingframes import generate_prompt, strategy_options
14
  from utils import get_image_html, collect_student_info
15
- from database_functions import add_submission
16
  from tab_teachers_dashboard import create_teachers_dashboard_tab
17
  from config import CLASS_OPTIONS
18
  from concurrent.futures import ThreadPoolExecutor
 
 
 
 
 
 
19
 
20
  # Load CSS from external file
21
  with open('styles.css', 'r') as file:
 
1
+ import subprocess
2
+
3
+ # Install flash attention
4
+ subprocess.run(
5
+ "pip install flash-attn --no-build-isolation",
6
+ env={"FLASH_ATTENTION_SKIP_CUDA_BUILD": "TRUE"},
7
+ shell=True,
8
+ check=True # This will raise an exception if the command fails
9
+ )
10
+
11
+ # Rest of your app.py code
12
  import gradio as gr
13
  import asyncio
14
  import os
 
16
  import soundfile as sf
17
  import numpy as np
18
  import logging
19
+ from transformers import pipeline
20
  from dotenv import load_dotenv
21
  from policy import user_acceptance_policy
22
  from styles import theme
23
+ from thinkingframes import generate_prompt, strategy_options, questions
24
  from utils import get_image_html, collect_student_info
25
+ from database_functions import add_user_privacy, add_submission
26
  from tab_teachers_dashboard import create_teachers_dashboard_tab
27
  from config import CLASS_OPTIONS
28
  from concurrent.futures import ThreadPoolExecutor
29
+ import spaces
30
+ from streaming_stt_nemo import Model
31
+ import edge_tts
32
+ import tempfile
33
+
34
+ load_dotenv()
35
 
36
  # Load CSS from external file
37
  with open('styles.css', 'r') as file: