aasherkamal216 commited on
Commit
dcfcec7
·
unverified ·
1 Parent(s): 62f82e8

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +0 -17
utils.py CHANGED
@@ -1,6 +1,4 @@
1
  import streamlit as st
2
- import speech_recognition as sr
3
- import tempfile
4
 
5
  def about():
6
  about_text = """This AI-powered Streamlit app allows users to interact with various LLMs through
@@ -32,18 +30,3 @@ def set_safety_settings():
32
  ]
33
 
34
  return safety_settings
35
-
36
- def speech_to_text(audio_bytes):
37
- with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as recording:
38
- recording.write(audio_bytes)
39
- temp_file_path = recording.name
40
-
41
- r = sr.Recognizer()
42
- with sr.AudioFile(temp_file_path) as source:
43
- recorded_voice = r.record(source)
44
-
45
- try:
46
- text = r.recognize_google(recorded_voice, language="en")
47
- return text
48
- except:
49
- return None
 
1
  import streamlit as st
 
 
2
 
3
  def about():
4
  about_text = """This AI-powered Streamlit app allows users to interact with various LLMs through
 
30
  ]
31
 
32
  return safety_settings