Text Classification
Transformers
Safetensors
Chinese
Yue Chinese
modernbert
zhlid
text-embeddings-inference
Instructions to use MusubiAI/ZHLID with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MusubiAI/ZHLID with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="MusubiAI/ZHLID")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("MusubiAI/ZHLID") model = AutoModelForSequenceClassification.from_pretrained("MusubiAI/ZHLID") - Notebooks
- Google Colab
- Kaggle
Upload README.md
Browse files
README.md
CHANGED
|
@@ -105,8 +105,7 @@ text = "孔子\n大成至圣先师孔丘,字仲尼,子姓,孔氏,敬称
|
|
| 105 |
|
| 106 |
output = llm.classify(text)[0]
|
| 107 |
probs = output.outputs.probs
|
| 108 |
-
|
| 109 |
-
probabilities = F.softmax(logits, dim=0)
|
| 110 |
|
| 111 |
# Get the top predicted class
|
| 112 |
top_idx = torch.argmax(probabilities).item()
|
|
|
|
| 105 |
|
| 106 |
output = llm.classify(text)[0]
|
| 107 |
probs = output.outputs.probs
|
| 108 |
+
probabilities = torch.tensor(output.outputs.probs)
|
|
|
|
| 109 |
|
| 110 |
# Get the top predicted class
|
| 111 |
top_idx = torch.argmax(probabilities).item()
|