Instructions to use malteklaes/based-CodeBERTa-language-id-llm-module with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use malteklaes/based-CodeBERTa-language-id-llm-module with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="malteklaes/based-CodeBERTa-language-id-llm-module")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("malteklaes/based-CodeBERTa-language-id-llm-module") model = AutoModelForSequenceClassification.from_pretrained("malteklaes/based-CodeBERTa-language-id-llm-module") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -42,15 +42,13 @@ This is the model card of a 🤗 transformers model that has been pushed on the
|
|
| 42 |
|
| 43 |
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 44 |
```python
|
| 45 |
-
from transformers import pipeline
|
| 46 |
|
| 47 |
checkpoint = "malteklaes/based-CodeBERTa-language-id-llm-module"
|
| 48 |
|
| 49 |
-
from transformers import TextClassificationPipeline
|
| 50 |
-
|
| 51 |
myPipeline = TextClassificationPipeline(
|
| 52 |
-
model=
|
| 53 |
-
tokenizer=
|
| 54 |
)
|
| 55 |
|
| 56 |
CODE_TO_IDENTIFY = "print('hello world')"
|
|
|
|
| 42 |
|
| 43 |
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 44 |
```python
|
| 45 |
+
from transformers import pipeline, TextClassificationPipeline, AutoTokenizer, AutoModelForSequenceClassification
|
| 46 |
|
| 47 |
checkpoint = "malteklaes/based-CodeBERTa-language-id-llm-module"
|
| 48 |
|
|
|
|
|
|
|
| 49 |
myPipeline = TextClassificationPipeline(
|
| 50 |
+
model=AutoModelForSequenceClassification.from_pretrained(checkpoint),
|
| 51 |
+
tokenizer=AutoTokenizer.from_pretrained(checkpoint)
|
| 52 |
)
|
| 53 |
|
| 54 |
CODE_TO_IDENTIFY = "print('hello world')"
|