Instructions to use barha/granite-cti-technique-mapping-350m-alora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use barha/granite-cti-technique-mapping-350m-alora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("ibm-granite/granite-4.0-350m") model = PeftModel.from_pretrained(base_model, "barha/granite-cti-technique-mapping-350m-alora") - Transformers
How to use barha/granite-cti-technique-mapping-350m-alora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="barha/granite-cti-technique-mapping-350m-alora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("barha/granite-cti-technique-mapping-350m-alora", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use barha/granite-cti-technique-mapping-350m-alora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "barha/granite-cti-technique-mapping-350m-alora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "barha/granite-cti-technique-mapping-350m-alora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/barha/granite-cti-technique-mapping-350m-alora
- SGLang
How to use barha/granite-cti-technique-mapping-350m-alora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "barha/granite-cti-technique-mapping-350m-alora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "barha/granite-cti-technique-mapping-350m-alora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "barha/granite-cti-technique-mapping-350m-alora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "barha/granite-cti-technique-mapping-350m-alora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use barha/granite-cti-technique-mapping-350m-alora with Docker Model Runner:
docker model run hf.co/barha/granite-cti-technique-mapping-350m-alora
Invalid JSON:Unexpected token 'I', ..."_metric": Infinity,
"... is not valid JSON
| { | |
| "best_global_step": null, | |
| "best_metric": Infinity, | |
| "best_model_checkpoint": null, | |
| "epoch": 1.0, | |
| "eval_steps": 500, | |
| "global_step": 47, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "entropy": 0.8770920187234879, | |
| "epoch": 0.02127659574468085, | |
| "grad_norm": 101.38615417480469, | |
| "learning_rate": 0.0, | |
| "loss": 11.496590614318848, | |
| "mean_token_accuracy": 0.22714237496256828, | |
| "num_tokens": 2486.0, | |
| "step": 1 | |
| }, | |
| { | |
| "entropy": 0.9114853590726852, | |
| "epoch": 0.0425531914893617, | |
| "grad_norm": 96.85296630859375, | |
| "learning_rate": 4e-05, | |
| "loss": 11.215909004211426, | |
| "mean_token_accuracy": 0.2649671100080013, | |
| "num_tokens": 4959.0, | |
| "step": 2 | |
| }, | |
| { | |
| "entropy": 1.2038442194461823, | |
| "epoch": 0.06382978723404255, | |
| "grad_norm": 73.84027862548828, | |
| "learning_rate": 8e-05, | |
| "loss": 9.273573875427246, | |
| "mean_token_accuracy": 0.37812498956918716, | |
| "num_tokens": 7552.0, | |
| "step": 3 | |
| }, | |
| { | |
| "entropy": 1.0524671226739883, | |
| "epoch": 0.0851063829787234, | |
| "grad_norm": 30.00477409362793, | |
| "learning_rate": 0.00012, | |
| "loss": 6.997811317443848, | |
| "mean_token_accuracy": 0.5748837292194366, | |
| "num_tokens": 10017.0, | |
| "step": 4 | |
| }, | |
| { | |
| "entropy": 1.0943913161754608, | |
| "epoch": 0.10638297872340426, | |
| "grad_norm": 29.77185821533203, | |
| "learning_rate": 0.00016, | |
| "loss": 5.874476432800293, | |
| "mean_token_accuracy": 0.6206140369176865, | |
| "num_tokens": 12542.0, | |
| "step": 5 | |
| }, | |
| { | |
| "entropy": 0.690106213092804, | |
| "epoch": 0.1276595744680851, | |
| "grad_norm": 28.456193923950195, | |
| "learning_rate": 0.0002, | |
| "loss": 4.93742036819458, | |
| "mean_token_accuracy": 0.7391025722026825, | |
| "num_tokens": 15108.0, | |
| "step": 6 | |
| }, | |
| { | |
| "entropy": 0.42824630439281464, | |
| "epoch": 0.14893617021276595, | |
| "grad_norm": 8.46117877960205, | |
| "learning_rate": 0.00019993770622619782, | |
| "loss": 4.776185512542725, | |
| "mean_token_accuracy": 0.7670790255069733, | |
| "num_tokens": 17715.0, | |
| "step": 7 | |
| }, | |
| { | |
| "entropy": 0.6275453418493271, | |
| "epoch": 0.1702127659574468, | |
| "grad_norm": 7.040255069732666, | |
| "learning_rate": 0.00019975090251507638, | |
| "loss": 4.601991653442383, | |
| "mean_token_accuracy": 0.7641165554523468, | |
| "num_tokens": 20143.0, | |
| "step": 8 | |
| }, | |
| { | |
| "entropy": 0.49182429164648056, | |
| "epoch": 0.19148936170212766, | |
| "grad_norm": 4.624846458435059, | |
| "learning_rate": 0.0001994398216007982, | |
| "loss": 4.511226654052734, | |
| "mean_token_accuracy": 0.7724626064300537, | |
| "num_tokens": 22656.0, | |
| "step": 9 | |
| }, | |
| { | |
| "entropy": 0.626158207654953, | |
| "epoch": 0.2127659574468085, | |
| "grad_norm": 7.813827037811279, | |
| "learning_rate": 0.00019900485105144543, | |
| "loss": 4.358890533447266, | |
| "mean_token_accuracy": 0.7753759473562241, | |
| "num_tokens": 25094.0, | |
| "step": 10 | |
| }, | |
| { | |
| "entropy": 0.5334508866071701, | |
| "epoch": 0.23404255319148937, | |
| "grad_norm": 3.6953277587890625, | |
| "learning_rate": 0.00019844653278615833, | |
| "loss": 4.273573875427246, | |
| "mean_token_accuracy": 0.7838225364685059, | |
| "num_tokens": 27456.0, | |
| "step": 11 | |
| }, | |
| { | |
| "entropy": 0.43513786792755127, | |
| "epoch": 0.2553191489361702, | |
| "grad_norm": 2.8964409828186035, | |
| "learning_rate": 0.00019776556239997146, | |
| "loss": 4.085248947143555, | |
| "mean_token_accuracy": 0.8868782967329025, | |
| "num_tokens": 29914.0, | |
| "step": 12 | |
| }, | |
| { | |
| "entropy": 0.3346208333969116, | |
| "epoch": 0.2765957446808511, | |
| "grad_norm": 5.369524955749512, | |
| "learning_rate": 0.00019696278829718883, | |
| "loss": 3.968517303466797, | |
| "mean_token_accuracy": 0.8908246159553528, | |
| "num_tokens": 32448.0, | |
| "step": 13 | |
| }, | |
| { | |
| "entropy": 0.33365894854068756, | |
| "epoch": 0.2978723404255319, | |
| "grad_norm": 2.550203800201416, | |
| "learning_rate": 0.00019603921063437793, | |
| "loss": 4.0511908531188965, | |
| "mean_token_accuracy": 0.8805366605520248, | |
| "num_tokens": 34909.0, | |
| "step": 14 | |
| }, | |
| { | |
| "entropy": 0.25230497866868973, | |
| "epoch": 0.3191489361702128, | |
| "grad_norm": 3.365182876586914, | |
| "learning_rate": 0.0001949959800742991, | |
| "loss": 4.221365928649902, | |
| "mean_token_accuracy": 0.8763548880815506, | |
| "num_tokens": 37476.0, | |
| "step": 15 | |
| }, | |
| { | |
| "entropy": 0.21353815868496895, | |
| "epoch": 0.3404255319148936, | |
| "grad_norm": 1.1460461616516113, | |
| "learning_rate": 0.00019383439635232294, | |
| "loss": 4.106394290924072, | |
| "mean_token_accuracy": 0.8868418335914612, | |
| "num_tokens": 39881.0, | |
| "step": 16 | |
| }, | |
| { | |
| "entropy": 0.21475103124976158, | |
| "epoch": 0.3617021276595745, | |
| "grad_norm": 3.043959617614746, | |
| "learning_rate": 0.00019255590665712214, | |
| "loss": 4.265631675720215, | |
| "mean_token_accuracy": 0.8690433949232101, | |
| "num_tokens": 42235.0, | |
| "step": 17 | |
| }, | |
| { | |
| "entropy": 0.1718740463256836, | |
| "epoch": 0.3829787234042553, | |
| "grad_norm": 0.8078291416168213, | |
| "learning_rate": 0.0001911621038276542, | |
| "loss": 4.106135368347168, | |
| "mean_token_accuracy": 0.892671525478363, | |
| "num_tokens": 44687.0, | |
| "step": 18 | |
| }, | |
| { | |
| "entropy": 0.16231479868292809, | |
| "epoch": 0.40425531914893614, | |
| "grad_norm": 0.9561502933502197, | |
| "learning_rate": 0.00018965472436868286, | |
| "loss": 4.120131015777588, | |
| "mean_token_accuracy": 0.8869824111461639, | |
| "num_tokens": 47206.0, | |
| "step": 19 | |
| }, | |
| { | |
| "entropy": 0.14364850148558617, | |
| "epoch": 0.425531914893617, | |
| "grad_norm": 0.9734947681427002, | |
| "learning_rate": 0.00018803564628730915, | |
| "loss": 4.03128719329834, | |
| "mean_token_accuracy": 0.8906020969152451, | |
| "num_tokens": 49799.0, | |
| "step": 20 | |
| }, | |
| { | |
| "entropy": 0.13312280178070068, | |
| "epoch": 0.44680851063829785, | |
| "grad_norm": 0.4489222764968872, | |
| "learning_rate": 0.00018630688675320842, | |
| "loss": 4.058135032653809, | |
| "mean_token_accuracy": 0.8986841887235641, | |
| "num_tokens": 52291.0, | |
| "step": 21 | |
| }, | |
| { | |
| "entropy": 0.13586510717868805, | |
| "epoch": 0.46808510638297873, | |
| "grad_norm": 0.7964894771575928, | |
| "learning_rate": 0.0001844705995854882, | |
| "loss": 3.965346574783325, | |
| "mean_token_accuracy": 0.8940518647432327, | |
| "num_tokens": 54812.0, | |
| "step": 22 | |
| }, | |
| { | |
| "entropy": 0.15179748088121414, | |
| "epoch": 0.48936170212765956, | |
| "grad_norm": 1.6409692764282227, | |
| "learning_rate": 0.00018252907256929775, | |
| "loss": 4.181431293487549, | |
| "mean_token_accuracy": 0.8783541172742844, | |
| "num_tokens": 57280.0, | |
| "step": 23 | |
| }, | |
| { | |
| "entropy": 0.11831228621304035, | |
| "epoch": 0.5106382978723404, | |
| "grad_norm": 0.7683380842208862, | |
| "learning_rate": 0.00018048472460553257, | |
| "loss": 4.24875545501709, | |
| "mean_token_accuracy": 0.8903311938047409, | |
| "num_tokens": 59802.0, | |
| "step": 24 | |
| }, | |
| { | |
| "entropy": 0.15002421662211418, | |
| "epoch": 0.5319148936170213, | |
| "grad_norm": 2.176997661590576, | |
| "learning_rate": 0.00017834010269718526, | |
| "loss": 4.15623664855957, | |
| "mean_token_accuracy": 0.8820056915283203, | |
| "num_tokens": 62271.0, | |
| "step": 25 | |
| }, | |
| { | |
| "entropy": 0.11383292451500893, | |
| "epoch": 0.5531914893617021, | |
| "grad_norm": 0.5305500030517578, | |
| "learning_rate": 0.0001760978787760968, | |
| "loss": 4.076779365539551, | |
| "mean_token_accuracy": 0.8941320031881332, | |
| "num_tokens": 64751.0, | |
| "step": 26 | |
| }, | |
| { | |
| "entropy": 0.13319513201713562, | |
| "epoch": 0.574468085106383, | |
| "grad_norm": 1.0374587774276733, | |
| "learning_rate": 0.00017376084637406222, | |
| "loss": 4.014706611633301, | |
| "mean_token_accuracy": 0.8837339729070663, | |
| "num_tokens": 67220.0, | |
| "step": 27 | |
| }, | |
| { | |
| "entropy": 0.13686015084385872, | |
| "epoch": 0.5957446808510638, | |
| "grad_norm": 1.387152075767517, | |
| "learning_rate": 0.00017133191714243805, | |
| "loss": 4.015310764312744, | |
| "mean_token_accuracy": 0.8779295533895493, | |
| "num_tokens": 69678.0, | |
| "step": 28 | |
| }, | |
| { | |
| "entropy": 0.13596300408244133, | |
| "epoch": 0.6170212765957447, | |
| "grad_norm": 1.2698324918746948, | |
| "learning_rate": 0.00016881411722458688, | |
| "loss": 3.992821455001831, | |
| "mean_token_accuracy": 0.8992939442396164, | |
| "num_tokens": 72158.0, | |
| "step": 29 | |
| }, | |
| { | |
| "entropy": 0.13812873139977455, | |
| "epoch": 0.6382978723404256, | |
| "grad_norm": 1.9082021713256836, | |
| "learning_rate": 0.00016621058348568007, | |
| "loss": 4.059752464294434, | |
| "mean_token_accuracy": 0.886225238442421, | |
| "num_tokens": 74621.0, | |
| "step": 30 | |
| }, | |
| { | |
| "entropy": 0.1471228487789631, | |
| "epoch": 0.6595744680851063, | |
| "grad_norm": 1.0790090560913086, | |
| "learning_rate": 0.00016352455960455387, | |
| "loss": 3.956774950027466, | |
| "mean_token_accuracy": 0.8888719379901886, | |
| "num_tokens": 77122.0, | |
| "step": 31 | |
| }, | |
| { | |
| "entropy": 0.13649508357048035, | |
| "epoch": 0.6808510638297872, | |
| "grad_norm": 0.8638296127319336, | |
| "learning_rate": 0.0001607593920324899, | |
| "loss": 4.1457977294921875, | |
| "mean_token_accuracy": 0.8863866329193115, | |
| "num_tokens": 79658.0, | |
| "step": 32 | |
| }, | |
| { | |
| "entropy": 0.13422205485403538, | |
| "epoch": 0.7021276595744681, | |
| "grad_norm": 0.8206593990325928, | |
| "learning_rate": 0.00015791852582395334, | |
| "loss": 4.104636192321777, | |
| "mean_token_accuracy": 0.893946647644043, | |
| "num_tokens": 82198.0, | |
| "step": 33 | |
| }, | |
| { | |
| "entropy": 0.13717253133654594, | |
| "epoch": 0.723404255319149, | |
| "grad_norm": 0.43719571828842163, | |
| "learning_rate": 0.00015500550034448413, | |
| "loss": 4.031332015991211, | |
| "mean_token_accuracy": 0.894197016954422, | |
| "num_tokens": 84670.0, | |
| "step": 34 | |
| }, | |
| { | |
| "entropy": 0.1137513667345047, | |
| "epoch": 0.7446808510638298, | |
| "grad_norm": 1.8441417217254639, | |
| "learning_rate": 0.0001520239448610882, | |
| "loss": 4.112149715423584, | |
| "mean_token_accuracy": 0.8909876793622971, | |
| "num_tokens": 87292.0, | |
| "step": 35 | |
| }, | |
| { | |
| "entropy": 0.11223667673766613, | |
| "epoch": 0.7659574468085106, | |
| "grad_norm": 0.4776930809020996, | |
| "learning_rate": 0.00014897757402062284, | |
| "loss": 4.026741027832031, | |
| "mean_token_accuracy": 0.8924113065004349, | |
| "num_tokens": 89830.0, | |
| "step": 36 | |
| }, | |
| { | |
| "entropy": 0.12275257520377636, | |
| "epoch": 0.7872340425531915, | |
| "grad_norm": 0.9828954935073853, | |
| "learning_rate": 0.00014587018322180905, | |
| "loss": 4.183655738830566, | |
| "mean_token_accuracy": 0.8827805668115616, | |
| "num_tokens": 92344.0, | |
| "step": 37 | |
| }, | |
| { | |
| "entropy": 0.12380701676011086, | |
| "epoch": 0.8085106382978723, | |
| "grad_norm": 1.3710100650787354, | |
| "learning_rate": 0.0001427056438866376, | |
| "loss": 4.003378868103027, | |
| "mean_token_accuracy": 0.8812988549470901, | |
| "num_tokens": 94826.0, | |
| "step": 38 | |
| }, | |
| { | |
| "entropy": 0.10968485288321972, | |
| "epoch": 0.8297872340425532, | |
| "grad_norm": 0.37869715690612793, | |
| "learning_rate": 0.00013948789863705912, | |
| "loss": 4.050682067871094, | |
| "mean_token_accuracy": 0.8941126763820648, | |
| "num_tokens": 97290.0, | |
| "step": 39 | |
| }, | |
| { | |
| "entropy": 0.12006617523729801, | |
| "epoch": 0.851063829787234, | |
| "grad_norm": 0.5866818428039551, | |
| "learning_rate": 0.00013622095638296826, | |
| "loss": 4.113466262817383, | |
| "mean_token_accuracy": 0.8894326388835907, | |
| "num_tokens": 99776.0, | |
| "step": 40 | |
| }, | |
| { | |
| "entropy": 0.09959963150322437, | |
| "epoch": 0.8723404255319149, | |
| "grad_norm": 0.4211389422416687, | |
| "learning_rate": 0.000132908887327601, | |
| "loss": 3.8911352157592773, | |
| "mean_token_accuracy": 0.8987201750278473, | |
| "num_tokens": 102278.0, | |
| "step": 41 | |
| }, | |
| { | |
| "entropy": 0.10989912413060665, | |
| "epoch": 0.8936170212765957, | |
| "grad_norm": 1.014770746231079, | |
| "learning_rate": 0.00012955581789656843, | |
| "loss": 4.067371845245361, | |
| "mean_token_accuracy": 0.8916666656732559, | |
| "num_tokens": 104764.0, | |
| "step": 42 | |
| }, | |
| { | |
| "entropy": 0.11506957560777664, | |
| "epoch": 0.9148936170212766, | |
| "grad_norm": 0.4580586552619934, | |
| "learning_rate": 0.0001261659255968441, | |
| "loss": 4.101069927215576, | |
| "mean_token_accuracy": 0.8936023861169815, | |
| "num_tokens": 107201.0, | |
| "step": 43 | |
| }, | |
| { | |
| "entropy": 0.10838168673217297, | |
| "epoch": 0.9361702127659575, | |
| "grad_norm": 0.4166942536830902, | |
| "learning_rate": 0.00012274343381211066, | |
| "loss": 4.025703430175781, | |
| "mean_token_accuracy": 0.8947224318981171, | |
| "num_tokens": 109660.0, | |
| "step": 44 | |
| }, | |
| { | |
| "entropy": 0.09614014439284801, | |
| "epoch": 0.9574468085106383, | |
| "grad_norm": 0.9769757390022278, | |
| "learning_rate": 0.00011929260654094969, | |
| "loss": 4.121439456939697, | |
| "mean_token_accuracy": 0.8903171271085739, | |
| "num_tokens": 112117.0, | |
| "step": 45 | |
| }, | |
| { | |
| "entropy": 0.11138966307044029, | |
| "epoch": 0.9787234042553191, | |
| "grad_norm": 1.5290015935897827, | |
| "learning_rate": 0.0001158177430844304, | |
| "loss": 4.022660732269287, | |
| "mean_token_accuracy": 0.8867548704147339, | |
| "num_tokens": 114595.0, | |
| "step": 46 | |
| }, | |
| { | |
| "entropy": 0.10535211116075516, | |
| "epoch": 1.0, | |
| "grad_norm": 0.6933005452156067, | |
| "learning_rate": 0.00011232317268971585, | |
| "loss": 4.150263786315918, | |
| "mean_token_accuracy": 0.8926616609096527, | |
| "num_tokens": 117080.0, | |
| "step": 47 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "eval_entropy": 0.0, | |
| "eval_loss": NaN, | |
| "eval_mean_token_accuracy": 0.0, | |
| "eval_num_tokens": 117080.0, | |
| "eval_runtime": 14.1972, | |
| "eval_samples_per_second": 21.131, | |
| "eval_steps_per_second": 5.283, | |
| "step": 47 | |
| } | |
| ], | |
| "logging_steps": 1, | |
| "max_steps": 94, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 2, | |
| "save_steps": 500, | |
| "stateful_callbacks": { | |
| "EarlyStoppingCallback": { | |
| "args": { | |
| "early_stopping_patience": 3, | |
| "early_stopping_threshold": 0.0 | |
| }, | |
| "attributes": { | |
| "early_stopping_patience_counter": 0 | |
| } | |
| }, | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": false | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 196239614279680.0, | |
| "train_batch_size": 2, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |