| | |
| | | default=8000, |
| | | required=False, |
| | | help="server port") |
| | | parser.add_argument("--add_pun", |
| | | type=int, |
| | | default=1, |
| | | required=False, |
| | | help="add pun to result") |
| | | parser.add_argument("--audio_path", |
| | | type=str, |
| | | default='asr_example_zh.wav', |
| | |
| | | |
| | | |
| | | url = f'http://{args.host}:{args.port}/recognition' |
| | | data = {'add_pun': args.add_pun} |
| | | headers = {} |
| | | files = [('audio', (os.path.basename(args.audio_path), open(args.audio_path, 'rb'), 'application/octet-stream'))] |
| | | |
| | | response = requests.post(url, headers=headers, data=data, files=files) |
| | | response = requests.post(url, headers=headers, files=files) |
| | | print(response.text) |