From 2a66366be4c2715870e4859fd5a5db6e8a9dc00a Mon Sep 17 00:00:00 2001
From: chenmengzheAAA <123789350+chenmengzheAAA@users.noreply.github.com>
Date: 星期四, 14 九月 2023 19:00:17 +0800
Subject: [PATCH] Merge pull request #956 from alibaba-damo-academy/chenmengzheAAA-patch-4
---
funasr/runtime/python/http/client.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/funasr/runtime/python/http/client.py b/funasr/runtime/python/http/client.py
index 272ce97..c237619 100644
--- a/funasr/runtime/python/http/client.py
+++ b/funasr/runtime/python/http/client.py
@@ -1,3 +1,5 @@
+import os
+
import requests
import argparse
@@ -32,7 +34,7 @@
url = f'http://{args.host}:{args.port}/recognition'
data = {'add_pun': args.add_pun}
headers = {}
-files = [('audio', ('file', open(args.audio_path, 'rb'), 'application/octet-stream'))]
+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)
print(response.text)
--
Gitblit v1.9.1