27 lines
804 B
Rust
27 lines
804 B
Rust
use rtx_diffuse::ip_adapter::*;
|
|
|
|
#[test]
|
|
fn test_basic_ip_adapter_functionality() {
|
|
// Test configuration creation
|
|
let config = IPAdapterConfig {
|
|
image_encoder_dim: 512,
|
|
cross_attention_dim: 768,
|
|
num_attention_heads: 8,
|
|
adapter_weight: 0.8,
|
|
num_tokens: 16,
|
|
};
|
|
|
|
// Create IP-Adapter
|
|
let adapter_result = IPAdapter::new(config);
|
|
|
|
// The test should pass if our implementation is correct
|
|
if let Ok(adapter) = adapter_result {
|
|
assert_eq!(adapter.config().adapter_weight, 0.8);
|
|
assert_eq!(adapter.config().num_tokens, 16);
|
|
println!("IP-Adapter created successfully!");
|
|
} else {
|
|
// This means we still need to implement more
|
|
println!("IP-Adapter creation failed - need to implement more");
|
|
}
|
|
}
|