Skip to content

Conversation

@wtomin
Copy link
Collaborator

@wtomin wtomin commented Nov 26, 2025

  • Add:

    1. model:
      EvollaForProteinText2Text
      EvollaPreTrainedModel
      EvollaModel

    2. fast UT: passed three UTs under pynative mode for [fp32, bf16, fp16]

  • Usage:

from mindone.transformers import EvollaProcessor, EvollaForProteinText2Text
from time import time
import mindspore as ms
st = time()
model = EvollaForProteinText2Text.from_pretrained("westlake-repl/Evolla-10B-DPO-hf")
processor = EvollaProcessor.from_pretrained("westlake-repl/Evolla-10B-DPO-hf")
print(f"load time {time() - st}")
protein_information = {
            "aa_seq": "your amino acid sequence",
            "foldseek": "your foldseek sequence",
        }
question = "What is the function of this protein?"
message = [
            {"role": "system", "content": "You are an AI expert that can answer any questions about protein."},
            {"role": "user", "content": question},
        ]

inputs = processor(proteins=[protein_information], messages_list=[message], return_tensors="np", padding="longest")
inputs = {key: ms.Tensor(value) for key, value in inputs.items()}
st = time()
outputs = model.generate(**inputs)
print(f"inference time {time() - st}")
print(processor.batch_decode(outputs, skip_special_tokens=True))
  • pt fp16 输出:
'system\n\nYou are an AI expert that can answer any questions about protein.user\n\nWhat is the function of this protein?assistant\n\nThis protein is a member of the peptidase M20 family, which is a group known'
  • ms fp16 输出:
  "system\n\nYou are an AI expert that can answer any questions about protein.user\n\nWhat is the function of this protein?assistant\n\nThis protein, which is part of the ABC transporter superfamily and specifically belongs to the LagD family, is likely involved in the transport of molecules across cellular membranes. Its function is probably centered around the ABC transporter complex, which is a well-known mechanism for the active transport of various substrates across biological membranes.\n\nThe protein's role within the complex could be critical for energy coupling, a process that is essential for the transport of molecules. This suggests that the protein may be responsible for facilitating the movement of specific substances by harnessing energy, possibly in the form of ATP hydrolysis, to drive the transport against a concentration gradient.\n\nGiven its sequence similarities and the fact that it is annotated with the GO term for ABC-type amino acid transporter activity, it is plausible that this protein is involved in the transport of amino acids or related molecules. The ATP-binding function, as indicated by its classification within the ABC transporter family, is a key aspect of its mechanism, as ATP-binding proteins are typically central to the energy-coupling process in these transporters.\n\nThe protein's involvement in the transport system also implies a potential interaction with other proteins within the complex. It may interact with other components of the ABC transporter to form a functional unit that can recognize, bind, and translocate its substrates across the membrane.\n\nThe protein's association with the LagD family further suggests a conserved structure and function among members of this family, which are often found in bacteria and archaea, indicating that the protein's role in transport is a fundamental biological process across different organisms.\n\nIn summary, the function of this protein is likely to be a part of an ABC transporter complex, where it contributes to the active transport of molecules across cellular membranes, possibly involving energy coupling and substrate recognition, and it is a member of a family known for its role in amino acid transport."
  • Inference Speed
verison mode model weight loading time cost dtype inference speed
ms2.7.0 pynative EvollaForProteinText2Text 148.1s fp32 1.75 tokens/s
ms2.7.0 pynative EvollaForProteinText2Text 150.1s fp16 1.73 tokens/s
ms2.7.0 pynative EvollaForProteinText2Text 156.4s bf16 1.68 tokens/s

@wtomin wtomin changed the title feat(transformers): Add ColQwen2 (v4.54.1) feat(transformers): Add Evolla (v4.54.1) Nov 26, 2025
@wtomin wtomin marked this pull request as ready for review November 26, 2025 01:51
@wtomin wtomin requested a review from vigo999 as a code owner November 26, 2025 01:51
@wtomin wtomin self-assigned this Dec 2, 2025
@wtomin wtomin added the new model add new model to mindone label Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new model add new model to mindone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant