C:\Users\Lenovo\anaconda3\envs\pytorch211\python.exe "huggingface.py" Downloading readme: 100%|██████████| 7.81k/7.81k [00:00<?, ?B/s] Downloading data: 100%|██████████| 21.0M/21.0M [00:27<00:00, 753kB/s] Downloading data: 100%|██████████| 20.5M/20.5M [00:07<00:00, 2.88MB/s] Downloading data: 100%|██████████| 42.0M/42.0M [00:08<00:00, 5.13MB/s] Generating train split: 100%|██████████| 25000/25000 [00:00<00:00, 347815.24 examples/s] Generating test split: 100%|██████████| 25000/25000 [00:00<00:00, 481791.57 examples/s] Generating unsupervised split: 100%|██████████| 50000/50000 [00:00<00:00, 450755.18 examples/s] C:\Users\Lenovo\anaconda3\envs\pytorch211\Lib\site-packages\huggingface_hub\file_download.py:149: UserWarning: `huggingface_hub` cache-system uses symlinks by default to efficiently store duplicated files but your machine does not support them in C:\Users\Lenovo\.cache\huggingface\hub\models--bert-base-cased. Caching files will still work but in a degraded version that might require more space on your disk. This warning can be disabled by setting the `HF_HUB_DISABLE_SYMLINKS_WARNING` environment variable. For more details, see https://huggingface.co/docs/huggingface_hub/how-to-cache#limitations. To support symlinks on Windows, you either need to activate Developer Mode or to run Python as an administrator. In order to see activate developer mode, see this article: https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development warnings.warn(message) Some weights of BertForSequenceClassification were not initialized from the model checkpoint at bert-base-cased and are newly initialized: ['classifier.bias', 'classifier.weight'] You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference. Example 1: Prediction: 正面评论, True label: 正面评论 Example 2: Prediction: 正面评论, True label: 正面评论 Example 3: Prediction: 正面评论, True label: 负面评论 Example 4: Prediction: 正面评论, True label: 正面评论 Example 5: Prediction: 正面评论, True label: 正面评论 Example 6: Prediction: 正面评论, True label: 正面评论 Example 7: Prediction: 正面评论, True label: 负面评论 Example 8: Prediction: 正面评论, True label: 负面评论 Example 9: Prediction: 正面评论, True label: 负面评论 Example 10: Prediction: 正面评论, True label: 负面评论
Hugging Face 也提醒我们,可能需要用一些下游任务重新训练这个模型(即微调),再用它来做预测和推理:You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference。
四、总结
Hugging Face 是当前最知名的 Transformer 工具库和 AI 开源模型网站,它的目标是让人们更方便地使用和开发 AI 模型。
什么是 Hugging Face?它的目标是什么?
Hugging Face Hugging Face 是一个 AI 社区网站,站内几乎囊括了所有的 AI 开源模型。Hugging Face 是当前最知名的 Transformer 工具库和 AI 开源模型网站,它的目标是让人们更方便地使用和开发 AI 模型。