Apply function.php filter only if url not has /amp/

What is amp? Is it tag or category or page? You should use standard wordpress functions like is_page() is_category() is_tag().

You can also use $wp->request. It will return the request URI. If the address is "http://example.com/slug1/slug2" it will return slug1/slug2 then use explode() function to split it.

<?php  $uri =  $wp->request; 
$slugs = explode("/",$uri);//variable $slugs will have array of slugs 

//$slugs[count($slugs)-1] will return last slug
if($slugs[count($slugs)-1] != "amp") {
//Apply your filter filter here
}
 ?>

Remember $wp is a global variable so if you want to use it inside a function the must use the keyword global before it.