Instructions to use qixun/qilv_classify with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use qixun/qilv_classify with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="qixun/qilv_classify")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("qixun/qilv_classify") model = AutoModelForSequenceClassification.from_pretrained("qixun/qilv_classify", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -49,8 +49,8 @@ tags:
|
|
| 49 |
# 准备输入数据
|
| 50 |
inputs = tokenizer(text, padding=True, truncation=True, return_tensors="pt", max_length=512)
|
| 51 |
|
| 52 |
-
# 将输入数据移动到GPU
|
| 53 |
-
inputs = {key: value.to(device) for key, value in inputs.items()}
|
| 54 |
|
| 55 |
# 模型推断
|
| 56 |
with torch.no_grad():
|
|
|
|
| 49 |
# 准备输入数据
|
| 50 |
inputs = tokenizer(text, padding=True, truncation=True, return_tensors="pt", max_length=512)
|
| 51 |
|
| 52 |
+
# 如GPU可用,将输入数据移动到GPU
|
| 53 |
+
#inputs = {key: value.to(device) for key, value in inputs.items()}
|
| 54 |
|
| 55 |
# 模型推断
|
| 56 |
with torch.no_grad():
|