Просмотр исходного кода

Merge pull request #1001 from alibaba-damo-academy/dev_lhn

Dev lhn
hnluo 2 лет назад
Родитель
Сommit
20ffa0e241
2 измененных файлов с 4 добавлено и 4 удалено
  1. 2 2
      .github/workflows/main.yml
  2. 2 2
      funasr/datasets/large_datasets/dataset.py

+ 2 - 2
.github/workflows/main.yml

@@ -23,7 +23,7 @@ jobs:
           pre-build-command: "pip install sphinx-markdown-tables nbsphinx jinja2 recommonmark sphinx_rtd_theme myst-parser"
           pre-build-command: "pip install sphinx-markdown-tables nbsphinx jinja2 recommonmark sphinx_rtd_theme myst-parser"
 
 
       - name: deploy copy
       - name: deploy copy
-        if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev_wjm' || github.ref == 'refs/heads/dev_lyh'
+        if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev_wjm' || github.ref == 'refs/heads/dev_lyh' || github.ref == 'refs/heads/dev_lhn'
         run: |
         run: |
           mkdir public
           mkdir public
           touch public/.nojekyll
           touch public/.nojekyll
@@ -35,7 +35,7 @@ jobs:
           cp -r docs/m2met2/_build/html/* public/m2met2/
           cp -r docs/m2met2/_build/html/* public/m2met2/
 
 
       - name: deploy github.io pages
       - name: deploy github.io pages
-        if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev_wjm' || github.ref == 'refs/heads/dev_lyh'
+        if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev_wjm' || github.ref == 'refs/heads/dev_lyh' || github.ref == 'refs/heads/dev_lhn'
         uses: peaceiris/actions-gh-pages@v2.3.1
         uses: peaceiris/actions-gh-pages@v2.3.1
         env:
         env:
           GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
           GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

+ 2 - 2
funasr/datasets/large_datasets/dataset.py

@@ -108,7 +108,7 @@ class AudioDataset(IterableDataset):
                     ark_reader = ReadHelper('ark:{}'.format(data_file))
                     ark_reader = ReadHelper('ark:{}'.format(data_file))
                     reader_list.append(ark_reader)
                     reader_list.append(ark_reader)
                 elif data_type == "text" or data_type == "sound" or data_type == 'text_hotword':
                 elif data_type == "text" or data_type == "sound" or data_type == 'text_hotword':
-                    text_reader = open(data_file, "r")
+                    text_reader = open(data_file, "r", encoding="utf-8")
                     reader_list.append(text_reader)
                     reader_list.append(text_reader)
                 elif data_type == "none":
                 elif data_type == "none":
                     continue
                     continue
@@ -205,7 +205,7 @@ def Dataset(data_list_file,
     # pre_prob = conf.get("pre_prob", 0)  # unused yet
     # pre_prob = conf.get("pre_prob", 0)  # unused yet
     if pre_hwfile is not None:
     if pre_hwfile is not None:
         pre_hwlist = []
         pre_hwlist = []
-        with open(pre_hwfile, 'r') as fin:
+        with open(pre_hwfile, 'r', encoding="utf-8") as fin:
             for line in fin.readlines():
             for line in fin.readlines():
                 pre_hwlist.append(line.strip())
                 pre_hwlist.append(line.strip())
     else:
     else: