Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Use file-like objects as parameters to train_* methods #754

@joshi-sh

Description

@joshi-sh

Currently, my workaround is to use tempfile as:

import tempfile
import fastText as ft
with tempfile.NamedTemporaryFile() as f:
    f.write(lines) 
    ft.train_supervised(input=f.name)

If I could instead pass a file-like object, it would be the single line ft.train_supervised(input=io.StringIO(initial_value=lines))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions