Add cmdline arguments to run phi-2#687
Conversation
|
I think we should just wait for #651 to be merged, which should happen very soon |
This workarounds are not specific for Phi-2, it's useful for all models which require trust_remote_code or need another transformers version |
I get that, but the problem is that we have absolutely no guarantee on the API provided by this kind of models. The name of the inputs or methods could be different from what Transformers expects. So it's basically impossible to ensure that these models will work. |
|
@nprotasov The release of Optimum Habana v1.10.2 is fully compatible with Transformers v4.37 so phi-2 can be used out of the box. I quickly tried the text-generation example with and it ran successfully. Note that it is not compatible with a static KV cache, which leads to a high number of generated HPU graphs (and thus high compilation time) due to the increasing size of this cache throughout the generation process. We could implement it and override parts of its modeling as we do for Llama and other optimized models if needed. |
To run Phi-2 model we need to do some workarounds, because Phi-2 is require (4.37.0.dev) of transformers, we can't call adapt_transformers_to_gaudi and we need to pass trust_remote_code to AutoModelForCausalLM