I'm using WAMP server and i have configured it to run python scripts and those scripts are executing but i was trying to run below script, this script is executing in windows terminal but when i try to execute it from browser with the help of wamp server then i'm getting this error :
Apache error log :
[Sat Nov 27 11:12:01.808031 2021] [cgi:error] [pid 6040:tid 1220] [client ::1:56483] End of script output before headers: test_nm.py
Apache access log :
::1 - - [27/Nov/2021:11:11:57 +0530] "-" 408 -
::1 - - [27/Nov/2021:11:12:01 +0530] "GET /test_nm.py HTTP/1.1" 500 653
Code
#!C:\Program Files\Python36\python.exe
print("Content-Type: text/html\n")
import numpy as np
import wave
from deepspeech import Model
from scipy.io import wavfile as wav
#import speech_recognition as sr
audio_file = "C:/deepspeechwk/audio/8455-210777-0068.wav"
ds = Model('C:/deepspeechwk/deepspeech-0.6.0-models/output_graph.pb',500)
ds.enableDecoderWithLM('C:/deepspeechwk/deepspeech-0.6.0-models/lm.binary','C:/deepspeechwk/deepspeech-0.6.0-models/trie', 0.75, 1.85)
rate, audio = wav.read(audio_file)
print(audio)
transcript =ds.stt(audio)
#print(transcript)
f = open("transcribe_text.txt", "a")
f.write(str(transcript))
f.close()
Screenshot :
Any solution to resolve this issue is highly appreciated, Thanks