簡體   English   中英

將數據集推送到 Hugging-face hub 時出現箭頭相關錯誤

[英]Arrow related error when pushing dataset to Hugging-face hub

我的數據集有很多問題:

(未來)數據集是我從泡菜文件加載的 pandas dataframe,pandas 數據集的行為正確。 我的代碼是:

dataset.from_pandas(df)
dataset.push_to_hub("username/my_dataset", private=True)

因為我認為這是 pandas 故障我也試過:

dataset = Dataset.from_dict(df_sentences.to_dict(orient='list'))
dataset.push_to_hub("username/my_dataset", private=True)

並從文件中加載它。

我得到的錯誤是:

ArrowNotImplementedError:Arrow 到 Parquet 架構轉換的未處理類型:字符串

我的數據集由 4 列字符串類型和一列整數組成,大約 3600 行

沒有可重現的樣本,很難對其進行測試,但一種選擇是將數據轉換為string[pyarrow]

dtypes = {
'column_a': 'string[pyarrow]',
'col_b': 'string[pyarrow]',
...
}

df_converted = df.astype(dtypes)
# proceed with the push

如果可能的話,我也會升級到最新版本,尤其是。 對於pyarrowpandas

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM