GitPulse is a multimodal Transformer-based model that combines project text descriptions with historical activity data to predict GitHub project health metrics.
1import torch
2from transformers import DistilBertTokenizer
3
4# Load model
5from model import GitPulseModel
6model = GitPulseModel.from_pretrained('./')
7
8# Prepare inputs
9tokenizer = DistilBertTokenizer.from_pretrained('distilbert-base-uncased')
10text = "A Python library for machine learning"
11encoded = tokenizer(text, padding='max_length', truncation=True,
12 max_length=128, return_tensors='pt')
13
14# Time series: [batch, hist_len, n_vars]
15time_series = torch.randn(1, 128, 16)
16
17# Predict
18model.eval()
19with torch.no_grad():
20 predictions = model(
21 time_series,
22 input_ids=encoded['input_ids'],
23 attention_mask=encoded['attention_mask']
24 )
25# predictions shape: [1, 32, 16]
1# Simple prediction interface
2predictions = model.predict(
3 time_series=history_data, # [batch, 128, 16]
4 text="Project description...",
5 tokenizer=tokenizer
6)
1@article{gitpulse2024,
2 title={GitPulse: Multimodal Time Series Prediction for GitHub Project Health},
3 author={Anonymous},
4 journal={arXiv preprint},
5 year={2024}
6}