pulkitchowdry commited on
Commit
d4fa62e
·
verified ·
1 Parent(s): 62fa325

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -3
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-generation", 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, AutoModelForMultimodalLM
37
 
38
  tokenizer = AutoTokenizer.from_pretrained("google-bert/bert-base-uncased")
39
- model = AutoModelForMultimodalLM.from_pretrained("pulkitchowdry/sample-agnews-classifer")
 
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)