You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/Users/simon/Dropbox/Development/openai-to-sqlite/openai_to_sqlite/cli.py", line 27, in embeddings
rows, _ = rows_from_file(input)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/simon/.local/share/virtualenvs/openai-to-sqlite-jt4obeb2/lib/python3.11/site-packages/sqlite_utils/utils.py", line 305, in rows_from_file
first_bytes = buffered.peek(2048).strip()
^^^^^^^^^^^^^^^^^^^
From this code:
@cli.command()@click.argument("db_path",type=click.Path(file_okay=True, dir_okay=False, allow_dash=False),)@click.option("-i","--input",type=click.File("r"),default="-",)defembeddings(db_path, input):
"Store embeddings for one or more text documents"click.echo("Here is some output")
db=sqlite_utils.Database(db_path)
rows, _=rows_from_file(input)
print(list(rows))
The error went away when I changed it to type=click.File("rb").
This should either be called out in the documentation or rows_from_file() should be fixed to handle text-mode files in addition to binary files.
The text was updated successfully, but these errors were encountered:
I got this error:
From this code:
The error went away when I changed it to
type=click.File("rb")
.This should either be called out in the documentation or
rows_from_file()
should be fixed to handle text-mode files in addition to binary files.The text was updated successfully, but these errors were encountered: