Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Torchaudio
Commits
d069fb9f
Unverified
Commit
d069fb9f
authored
Apr 01, 2020
by
Bhargav Kathivarapu
Committed by
GitHub
Apr 01, 2020
Browse files
Replace six with python3 version (#486)
parent
4c221140
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
21 deletions
+5
-21
.circleci/docker/Dockerfile
.circleci/docker/Dockerfile
+1
-1
README.md
README.md
+0
-2
examples/interactive_asr/vad.py
examples/interactive_asr/vad.py
+1
-1
torchaudio/datasets/utils.py
torchaudio/datasets/utils.py
+3
-17
No files found.
.circleci/docker/Dockerfile
View file @
d069fb9f
...
@@ -30,7 +30,7 @@ RUN conda create -y --name python3.6 python=3.6
...
@@ -30,7 +30,7 @@ RUN conda create -y --name python3.6 python=3.6
RUN
conda create
-y
--name
python3.7
python
=
3.7
RUN
conda create
-y
--name
python3.7
python
=
3.7
SHELL
[ "/bin/bash", "-c" ]
SHELL
[ "/bin/bash", "-c" ]
RUN
echo
"source /usr/local/etc/profile.d/conda.sh"
>>
~/.bashrc
RUN
echo
"source /usr/local/etc/profile.d/conda.sh"
>>
~/.bashrc
RUN
source
/usr/local/etc/profile.d/conda.sh
&&
conda activate python3.5
&&
conda
install
-y
-c
conda-forge sox
&&
conda
install
-y
numpy
six
RUN
source
/usr/local/etc/profile.d/conda.sh
&&
conda activate python3.5
&&
conda
install
-y
-c
conda-forge sox
&&
conda
install
-y
numpy
RUN
source
/usr/local/etc/profile.d/conda.sh
&&
conda activate python3.6
&&
conda
install
-y
-c
conda-forge sox
&&
conda
install
-y
numpy
RUN
source
/usr/local/etc/profile.d/conda.sh
&&
conda activate python3.6
&&
conda
install
-y
-c
conda-forge sox
&&
conda
install
-y
numpy
RUN
source
/usr/local/etc/profile.d/conda.sh
&&
conda activate python3.7
&&
conda
install
-y
-c
conda-forge sox
&&
conda
install
-y
numpy
RUN
source
/usr/local/etc/profile.d/conda.sh
&&
conda activate python3.7
&&
conda
install
-y
-c
conda-forge sox
&&
conda
install
-y
numpy
CMD
[ "/bin/bash"]
CMD
[ "/bin/bash"]
README.md
View file @
d069fb9f
...
@@ -70,8 +70,6 @@ build nightlies based on PyTorch nightlies by hand following the instructions in
...
@@ -70,8 +70,6 @@ build nightlies based on PyTorch nightlies by hand following the instructions in
```
```
pip install numpy
pip install numpy
pip install future # only on python 2.7
pip install six # only on python 3.5
pip install torchaudio_nightly -f https://download.pytorch.org/whl/nightly/torch_nightly.html
pip install torchaudio_nightly -f https://download.pytorch.org/whl/nightly/torch_nightly.html
```
```
...
...
examples/interactive_asr/vad.py
View file @
d069fb9f
...
@@ -21,7 +21,7 @@ from collections import deque
...
@@ -21,7 +21,7 @@ from collections import deque
import
numpy
as
np
import
numpy
as
np
import
torch
import
torch
from
six.moves
import
queue
import
queue
import
librosa
import
librosa
import
pyaudio
import
pyaudio
...
...
torchaudio/datasets/utils.py
View file @
d069fb9f
...
@@ -9,9 +9,8 @@ import threading
...
@@ -9,9 +9,8 @@ import threading
import
zipfile
import
zipfile
from
queue
import
Queue
from
queue
import
Queue
import
six
import
torch
import
torch
from
six.moves
import
urllib
import
urllib
from
torch.utils.data
import
Dataset
from
torch.utils.data
import
Dataset
from
torch.utils.model_zoo
import
tqdm
from
torch.utils.model_zoo
import
tqdm
...
@@ -41,21 +40,8 @@ def unicode_csv_reader(unicode_csv_data, **kwargs):
...
@@ -41,21 +40,8 @@ def unicode_csv_reader(unicode_csv_data, **kwargs):
maxInt
=
int
(
maxInt
/
10
)
maxInt
=
int
(
maxInt
/
10
)
csv
.
field_size_limit
(
maxInt
)
csv
.
field_size_limit
(
maxInt
)
if
six
.
PY2
:
for
line
in
csv
.
reader
(
unicode_csv_data
,
**
kwargs
):
# Implementation borrowed from docs:
yield
line
# https://docs.python.org/3.0/library/csv.html#examples
def
utf_8_encoder
(
unicode_csv_data
):
for
line
in
unicode_csv_data
:
yield
line
.
encode
(
'utf-8'
)
# csv.py doesn't do Unicode; encode temporarily as UTF-8:
csv_reader
=
csv
.
reader
(
utf_8_encoder
(
unicode_csv_data
),
**
kwargs
)
for
row
in
csv_reader
:
# decode UTF-8 back to Unicode, cell by cell:
yield
[
cell
.
decode
(
"utf-8"
)
for
cell
in
row
]
else
:
for
line
in
csv
.
reader
(
unicode_csv_data
,
**
kwargs
):
yield
line
def
makedir_exist_ok
(
dirpath
):
def
makedir_exist_ok
(
dirpath
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment