sihuapeng commited on
Commit
4ecd8e3
·
verified ·
1 Parent(s): c5558bc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -4
README.md CHANGED
@@ -41,7 +41,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
41
  model = AutoModelForSequenceClassification.from_pretrained(model_name)
42
 
43
  # Define the amino acid sequence
44
- sequence = "MKFLIVFVALFAMAVARPNLAEIVRQVSDVEPEKWSSDVETSDGTSIKQEGVLKNAGTDNEAAVVHGSFTWVDEKTGEKFTITYVADENGYQPQGAHLPVAPVA"
45
 
46
  # Tokenize the sequence
47
  inputs = tokenizer(sequence, return_tensors="pt")
@@ -52,9 +52,11 @@ with torch.no_grad():
52
  logits = outputs.logits
53
  predicted_class_id = logits.argmax().item()
54
 
55
- # Map the predicted class id to the class label
56
- labels = ["SP", "MT", "CH", "TH", "Other"]
57
- predicted_label = labels[predicted_class_id]
 
 
58
 
59
  print(f"The predicted class for the sequence is: {predicted_label}")
60
 
 
41
  model = AutoModelForSequenceClassification.from_pretrained(model_name)
42
 
43
  # Define the amino acid sequence
44
+ sequence = "MNSLLMITACLALVGTVWAKEGYLVNSYTGCKFECFKLGDNDYCLRECRQQYGKGSGGYCYAFGCWCTHLYEQAVVWPLPNKTCNGK"
45
 
46
  # Tokenize the sequence
47
  inputs = tokenizer(sequence, return_tensors="pt")
 
52
  logits = outputs.logits
53
  predicted_class_id = logits.argmax().item()
54
 
55
+ # Define the ID to Label mapping
56
+ id2label = {0: 'CH', 1: 'MT', 2: 'Other', 3: 'SP', 4: 'TH'}
57
+
58
+ # Get the predicted label
59
+ predicted_label = id2label[predicted_class_id]
60
 
61
  print(f"The predicted class for the sequence is: {predicted_label}")
62