lmoncla commited on
Commit
879826e
·
verified ·
1 Parent(s): f9c30fa

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -1
README.md CHANGED
@@ -91,7 +91,10 @@ import torch
91
  from transformers import pipeline
92
  device = torch.device("mps" if torch.backends.mps.is_available() else ("cuda" if torch.cuda.is_available() else "cpu"))
93
 
94
- pipe = pipeline("text-classification", model="GEODE/bert-base-multilingual-cased-geography-entry-classification", device=device)
 
 
 
95
 
96
  samples = [
97
  "* ALBI, (Géog.) ville de France, capitale de l'Albigeois, dans le haut Languedoc : elle est sur le Tarn. Long. 19. 49. lat. 43. 55. 44.",
 
91
  from transformers import pipeline
92
  device = torch.device("mps" if torch.backends.mps.is_available() else ("cuda" if torch.cuda.is_available() else "cpu"))
93
 
94
+ tokenizer = AutoTokenizer.from_pretrained("GEODE/bert-base-multilingual-cased-geography-entry-classification")
95
+ model = AutoModelForSequenceClassification.from_pretrained("GEODE/bert-base-multilingual-cased-geography-entry-classification")
96
+
97
+ pipe = pipeline("text-classification", model=model, tokenizer=tokenizer, truncation=True, device=device)
98
 
99
  samples = [
100
  "* ALBI, (Géog.) ville de France, capitale de l'Albigeois, dans le haut Languedoc : elle est sur le Tarn. Long. 19. 49. lat. 43. 55. 44.",