|  | --- | 
					
						
						|  | tags: | 
					
						
						|  | - model_hub_mixin | 
					
						
						|  | - pytorch_model_hub_mixin | 
					
						
						|  | --- | 
					
						
						|  |  | 
					
						
						|  | ### How to use | 
					
						
						|  |  | 
					
						
						|  | Until its next release, the transformers library needs to be installed from source with the following command in order to use the models. | 
					
						
						|  | PyTorch should also be installed. | 
					
						
						|  |  | 
					
						
						|  | ``` | 
					
						
						|  | pip install --upgrade git+https://github.com/huggingface/transformers.git | 
					
						
						|  | pip install torch | 
					
						
						|  | ``` | 
					
						
						|  |  | 
					
						
						|  | A small snippet of code is given here in order to infer with the model from random input. | 
					
						
						|  |  | 
					
						
						|  | ``` | 
					
						
						|  | import torch | 
					
						
						|  | from transformers import AutoModel | 
					
						
						|  |  | 
					
						
						|  | model = AutoModel.from_pretrained( | 
					
						
						|  | "InstaDeepAI/sCellTransformer", | 
					
						
						|  | trust_remote_code=True, | 
					
						
						|  | ) | 
					
						
						|  | num_cells = model.config.num_cells | 
					
						
						|  | dummy_gene_expressions = torch.randint(0, 5, (1, 19968 * num_cells)) | 
					
						
						|  | torch_output = model(dummy_gene_expressions) | 
					
						
						|  | ``` |