Skip to content

Commit

Permalink
update main.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
zachcp committed Jan 2, 2025
1 parent ac33da4 commit 6fda20c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ferritin-examples/examples/amplify/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,20 @@ fn main() -> Result<()> {

let token_ids = Tensor::new(&tokens[..], device)?.unsqueeze(0)?;
println!("Encoding.......");
let encoded = model.forward(&token_ids, None, false, false)?;
let encoded = model.forward(&token_ids, None, false, true)?;

println!("Predicting.......");
let predictions = encoded.logits.argmax(D::Minus1)?;
println!("Pred Dims: {:?}", encoded.logits.dims());

println!("Decoding.......");
let indices: Vec<u32> = predictions.to_vec2()?[0].to_vec();
let decoded = tokenizer.decode(indices.as_slice(), true);

println!("Decoded: {:?}, ", decoded);

let contact_map = encoded.get_contact_map()?;
println!("Contact Map Calculated: {:?}, ", contact_map);
}

Ok(())
Expand Down

0 comments on commit 6fda20c

Please sign in to comment.