this is my repository - GitHub - aditya230302/Lexi
main.py file is the one I am deploying.
The app works fine on local host but on Cloud its showing:
when using audio features:
OSError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).
Traceback:
File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script
exec(code, module.__dict__)File "/mount/src/lexi/Main.py", line 401, in <module>
with sr.Microphone() as source:
^^^^^^^^^^^^^^^File "/home/adminuser/venv/lib/python3.11/site-packages/speech_recognition/__init__.py", line 99, in __init__
self.audio = NoneFile "/home/adminuser/venv/lib/python3.11/site-packages/pyaudio/__init__.py", line 812, in get_default_input_device_info
device_index = pa.get_default_input_device()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
and when using OCR:
AttributeError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).
Traceback:
File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script
exec(code, module.__dict__)File "/mount/src/lexi/Main.py", line 517, in <module>
ocr_result_image = perform_ocr_on_image(image_bytes, selected_ocr_language_image)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/mount/src/lexi/Main.py", line 273, in perform_ocr_on_image
result = reader.readtext(img_np)
^^^^^^^^^^^^^^^^^^^^^^^File "/home/adminuser/venv/lib/python3.11/site-packages/easyocr/easyocr.py", line 464, in readtext
bbox_min_size = bbox_min_size, max_candidates = max_candidatesFile "/home/adminuser/venv/lib/python3.11/site-packages/easyocr/easyocr.py", line 383, in recognize
image_list, max_width = get_image_list(h_list, f_list, img_cv_grey, model_height = imgH)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/home/adminuser/venv/lib/python3.11/site-packages/easyocr/utils.py", line 613, in get_image_list
crop_img,ratio = compute_ratio_and_resize(crop_img,width,height,model_height)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/home/adminuser/venv/lib/python3.11/site-packages/easyocr/utils.py", line 576, in compute_ratio_and_resize
img = cv2.resize(img,(int(model_height*ratio),model_height),interpolation=Image.Resampling.LANCZOS)
can someone help me resolve this issue