Views
No views yet
cesarali/AICME-runtimecesarali/AICMEPK_clustergenerate, predictgenerateAutoModel.from_pretrained(..., trust_remote_code=True)sim_priors_pk to use this runtime bundle.transformers is the public loading entrypoint, but transformers alone is
not sufficient because this is a PyTorch model with custom runtime code. A
reliable consumer environment is:pip install torch transformers huggingface_hub lightning datasets pandas torchtyping gpytorch pot torchdiffeq torchsde ruamel.yaml pyyaml1from transformers import AutoModel
2
3model = AutoModel.from_pretrained("cesarali/AICME-runtime", trust_remote_code=True)
4
5studies = [
6 {
7 "context": [
8 {
9 "name_id": "ctx_0",
10 "observations": [0.2, 0.5, 0.3],
11 "observation_times": [0.5, 1.0, 2.0],
12 "dosing": [1.0],
13 "dosing_type": ["oral"],
14 "dosing_times": [0.0],
15 "dosing_name": ["oral"],
16 }
17 ],
18 "target": [],
19 "meta_data": {"study_name": "demo", "substance_name": "drug_x"},
20 }
21]
22
23outputs = model.run_task(
24 task="generate",
25 studies=studies,
26 num_samples=4,
27)
28print(outputs["results"][0]["samples"])1from transformers import AutoModel
2
3model = AutoModel.from_pretrained("cesarali/AICME-runtime", trust_remote_code=True)
4
5predict_studies = [
6 {
7 "context": [
8 {
9 "name_id": "ctx_0",
10 "observations": [0.2, 0.5, 0.3],
11 "observation_times": [0.5, 1.0, 2.0],
12 "dosing": [1.0],
13 "dosing_type": ["oral"],
14 "dosing_times": [0.0],
15 "dosing_name": ["oral"],
16 }
17 ],
18 "target": [
19 {
20 "name_id": "tgt_0",
21 "observations": [0.25, 0.31],
22 "observation_times": [0.5, 1.0],
23 "remaining": [0.0, 0.0, 0.0],
24 "remaining_times": [2.0, 4.0, 8.0],
25 "dosing": [1.0],
26 "dosing_type": ["oral"],
27 "dosing_times": [0.0],
28 "dosing_name": ["oral"],
29 }
30 ],
31 "meta_data": {"study_name": "demo", "substance_name": "drug_x"},
32 }
33]
34
35outputs = model.run_task(
36 task="predict",
37 studies=predict_studies,
38 num_samples=4,
39)
40print(outputs["results"][0]["samples"][0]["target"][0]["prediction_samples"])trust_remote_code=True is required because this model uses custom Hugging Face Hub runtime code.transformers + run_task(...); the consumer does not need a local clone of this repository.