@@ -306,11 +306,11 @@ def train(self, bytes_gen: Iterator[bytes] = None, **kwargs):
306
306
.. highlight:: python
307
307
.. code-block:: python
308
308
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
+ ...
314
314
315
315
316
316
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):
322
322
.. highlight:: python
323
323
.. code-block:: python
324
324
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
328
328
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())
331
331
332
332
:param bytes_gen: An iterator of bytes. If not given, then you have to specify it in `kwargs`.
333
333
:param kwargs: accepts all keyword arguments of `gnes client` CLI
@@ -342,11 +342,11 @@ def index(self, bytes_gen: Iterator[bytes] = None, **kwargs):
342
342
.. highlight:: python
343
343
.. code-block:: python
344
344
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
+ ...
350
350
351
351
352
352
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):
358
358
.. highlight:: python
359
359
.. code-block:: python
360
360
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
364
364
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())
367
367
368
368
It will start a :py:class:`CLIClient` and call :py:func:`index`.
369
369
@@ -383,11 +383,11 @@ def query(self, bytes_gen: Iterator[bytes] = None, **kwargs):
383
383
.. highlight:: python
384
384
.. code-block:: python
385
385
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
+ ...
391
391
392
392
393
393
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):
399
399
.. highlight:: python
400
400
.. code-block:: python
401
401
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
405
405
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())
408
408
409
409
:param bytes_gen: An iterator of bytes. If not given, then you have to specify it in `kwargs`.
410
410
:param kwargs: accepts all keyword arguments of `gnes client` CLI
0 commit comments