Skip to content
This repository was archived by the owner on Feb 22, 2020. It is now read-only.

Commit 97efb59

Browse files
author
Han Xiao
authored
Merge pull request #349 from gnes-ai/fix-docs-flow
docs(flow): fix formatting in flow docs
2 parents da50be0 + c36444b commit 97efb59

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

gnes/flow/__init__.py

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,11 @@ def train(self, bytes_gen: Iterator[bytes] = None, **kwargs):
306306
.. highlight:: python
307307
.. code-block:: python
308308
309-
with f.build(backend='thread') as flow:
310-
flow.train(txt_file='aa.txt')
311-
flow.train(image_zip_file='aa.zip', batch_size=64)
312-
flow.train(video_zip_file='aa.zip')
313-
...
309+
with f.build(backend='thread') as flow:
310+
flow.train(txt_file='aa.txt')
311+
flow.train(image_zip_file='aa.zip', batch_size=64)
312+
flow.train(video_zip_file='aa.zip')
313+
...
314314
315315
316316
This will call the pre-built reader to read files into an iterator of bytes and feed to the flow.
@@ -322,12 +322,12 @@ def train(self, bytes_gen: Iterator[bytes] = None, **kwargs):
322322
.. highlight:: python
323323
.. code-block:: python
324324
325-
def my_reader():
326-
for _ in range(10):
327-
yield b'abcdfeg' # each yield generates a document for training
325+
def my_reader():
326+
for _ in range(10):
327+
yield b'abcdfeg' # each yield generates a document for training
328328
329-
with f.build(backend='thread') as flow:
330-
flow.train(bytes_gen=my_reader())
329+
with f.build(backend='thread') as flow:
330+
flow.train(bytes_gen=my_reader())
331331
332332
:param bytes_gen: An iterator of bytes. If not given, then you have to specify it in `kwargs`.
333333
:param kwargs: accepts all keyword arguments of `gnes client` CLI
@@ -342,11 +342,11 @@ def index(self, bytes_gen: Iterator[bytes] = None, **kwargs):
342342
.. highlight:: python
343343
.. code-block:: python
344344
345-
with f.build(backend='thread') as flow:
346-
flow.index(txt_file='aa.txt')
347-
flow.index(image_zip_file='aa.zip', batch_size=64)
348-
flow.index(video_zip_file='aa.zip')
349-
...
345+
with f.build(backend='thread') as flow:
346+
flow.index(txt_file='aa.txt')
347+
flow.index(image_zip_file='aa.zip', batch_size=64)
348+
flow.index(video_zip_file='aa.zip')
349+
...
350350
351351
352352
This will call the pre-built reader to read files into an iterator of bytes and feed to the flow.
@@ -358,12 +358,12 @@ def index(self, bytes_gen: Iterator[bytes] = None, **kwargs):
358358
.. highlight:: python
359359
.. code-block:: python
360360
361-
def my_reader():
362-
for _ in range(10):
363-
yield b'abcdfeg' # each yield generates a document to index
361+
def my_reader():
362+
for _ in range(10):
363+
yield b'abcdfeg' # each yield generates a document to index
364364
365-
with f.build(backend='thread') as flow:
366-
flow.index(bytes_gen=my_reader())
365+
with f.build(backend='thread') as flow:
366+
flow.index(bytes_gen=my_reader())
367367
368368
It will start a :py:class:`CLIClient` and call :py:func:`index`.
369369
@@ -383,11 +383,11 @@ def query(self, bytes_gen: Iterator[bytes] = None, **kwargs):
383383
.. highlight:: python
384384
.. code-block:: python
385385
386-
with f.build(backend='thread') as flow:
387-
flow.query(txt_file='aa.txt')
388-
flow.query(image_zip_file='aa.zip', batch_size=64)
389-
flow.query(video_zip_file='aa.zip')
390-
...
386+
with f.build(backend='thread') as flow:
387+
flow.query(txt_file='aa.txt')
388+
flow.query(image_zip_file='aa.zip', batch_size=64)
389+
flow.query(video_zip_file='aa.zip')
390+
...
391391
392392
393393
This will call the pre-built reader to read files into an iterator of bytes and feed to the flow.
@@ -399,12 +399,12 @@ def query(self, bytes_gen: Iterator[bytes] = None, **kwargs):
399399
.. highlight:: python
400400
.. code-block:: python
401401
402-
def my_reader():
403-
for _ in range(10):
404-
yield b'abcdfeg' # each yield generates a query for searching
402+
def my_reader():
403+
for _ in range(10):
404+
yield b'abcdfeg' # each yield generates a query for searching
405405
406-
with f.build(backend='thread') as flow:
407-
flow.query(bytes_gen=my_reader())
406+
with f.build(backend='thread') as flow:
407+
flow.query(bytes_gen=my_reader())
408408
409409
:param bytes_gen: An iterator of bytes. If not given, then you have to specify it in `kwargs`.
410410
:param kwargs: accepts all keyword arguments of `gnes client` CLI

0 commit comments

Comments
 (0)