# OpenTSLM/gemma-3-270m-ecg-sp This model is part of the OpenTSLM project and was trained on ECG Question Answering using Gemma 3 270M as the base language model with Soft Prompt architecture. ## Paper For details, please refer to our publication: **OpenTSLM: Time-Series Language Models for Reasoning over Multivariate Medical Text- and Time-Series Data** Paper: https://huggingface.co/papers/2510.02410 ## Usage Please check out the [OpenTSLM](https://github.com/OpenTSLM/OpenTSLM) repository for detailed usage examples. ```python import sys import os sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "src"))) from model.llm.OpenTSLM import OpenTSLM from time_series_datasets.TSQADataset import TSQADataset from time_series_datasets.util import extend_time_series_to_match_patch_size_and_aggregate from torch.utils.data import DataLoader from model_config import PATCH_SIZE REPO_ID = "OpenTSLM/llama-3.2-1b-tsqa-sp" # Use CPU or CUDA for inference. MPS does NOT work for pretrained HF checkpoints. model = OpenTSLM.load_pretrained(REPO_ID, device="cuda" if torch.cuda.is_available() else "cpu") test_dataset = TSQADataset("test", EOS_TOKEN=model.get_eos_token()) test_loader = DataLoader( test_dataset, shuffle=False, batch_size=1, collate_fn=lambda batch: extend_time_series_to_match_patch_size_and_aggregate( batch, patch_size=PATCH_SIZE ), ) for i, batch in enumerate(test_loader): predictions = model.generate(batch, max_new_tokens=200) for sample, pred in zip(batch, predictions): print("Question:", sample.get("pre_prompt", "N/A")) print("Answer:", sample.get("answer", "N/A")) print("Output:", pred) if i >= 4: break ``` ## Citation If you use this model, please cite: ```bibtex @misc{langer2025opentslm, title = {OpenTSLM: Time-Series Language Models for Reasoning over Multivariate Medical Text- and Time-Series Data}, author = {Langer, Patrick and Kaar, Thomas and Rosenblattl, Max and Xu, Maxwell A and Chow, Winnie and Maritsch, Martin and Verma, Aradhana and Han, Brian and Kim, Daniel Seung and Chubb, Henry and Ceresnak, Scott and Zahedivash, Aydin and Tarlochan, Alexander and Sandhu, Singh and Rodriguez, Fatima and Mcduff, Daniel and Fleisch, Elgar and Aalami, Oliver and Barata, Filipe and Schmiedmayer, Paul}, year = {2025}, note = {Preprint}, doi = {doi.org/10.13140/RG.2.2.14827.60963} } ``` ## License This model is released under the MIT license.