Update README.md
Browse files
README.md
CHANGED
|
@@ -28,15 +28,16 @@ You can use the model using pipeline or AutoModelForMultimodalLM options offered
|
|
| 28 |
# Use a pipeline as a high-level helper
|
| 29 |
from transformers import pipeline
|
| 30 |
|
| 31 |
-
pipe = pipeline("text-
|
| 32 |
text = "US-Iran sign a peace deal"
|
| 33 |
pipe(text)
|
| 34 |
|
| 35 |
# Load model directly
|
| 36 |
-
from transformers import AutoTokenizer,
|
| 37 |
|
| 38 |
tokenizer = AutoTokenizer.from_pretrained("google-bert/bert-base-uncased")
|
| 39 |
-
model =
|
|
|
|
| 40 |
text = "US-Iran sign a peace deal"
|
| 41 |
inputs = tokenizer(text, return_tensors="pt", padding="max_length", truncation=True, max_length=128)
|
| 42 |
prediction = model(inputs)
|
|
|
|
| 28 |
# Use a pipeline as a high-level helper
|
| 29 |
from transformers import pipeline
|
| 30 |
|
| 31 |
+
pipe = pipeline("text-classification", model="pulkitchowdry/sample-agnews-classifer")
|
| 32 |
text = "US-Iran sign a peace deal"
|
| 33 |
pipe(text)
|
| 34 |
|
| 35 |
# Load model directly
|
| 36 |
+
from transformers import AutoTokenizer, AutoModel
|
| 37 |
|
| 38 |
tokenizer = AutoTokenizer.from_pretrained("google-bert/bert-base-uncased")
|
| 39 |
+
model = AutoModel.from_pretrained("pulkitchowdry/sample-agnews-classifer", dtype="auto")
|
| 40 |
+
|
| 41 |
text = "US-Iran sign a peace deal"
|
| 42 |
inputs = tokenizer(text, return_tensors="pt", padding="max_length", truncation=True, max_length=128)
|
| 43 |
prediction = model(inputs)
|