Text Generation
Transformers
PyTorch
code
gpt2
swift
mobile
generation
text-generation-inference

Run this model with HF Jobs

Run mvasiliniuc/iva-codeint-swift-small on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/mvasiliniuc/iva-codeint-swift-small. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/mvasiliniuc/iva-codeint-swift-small on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/mvasiliniuc/iva-codeint-swift-small. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/mvasiliniuc/iva-codeint-swift-small. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

iva-codeint-swift-small GPT-2 is (small version - 239.4M parameters) trained from scratch to obtain results in the text-to-code task tailored for Swift language used in native mobile development (iOS).

Usage

from transformers import pipeline

pipe = pipeline("text-generation", model="mvasiliniuc/iva-codeint-swift-small")
outputs = pipe("func triggerNSNotification")

Inference

API_URL = "https://api-inference.huggingface.co/models/mvasiliniuc/iva-codeint-swift-small"
headers = {"Authorization": "Bearer <key>"}
def query(payload):
    response = requests.post(API_URL, headers=headers, json=payload)
    return response.json()

output = query({
"inputs": """
/* 
A function that gets the current device operating system.
*/
"""
})
pprint.pprint(output, compact=True)

Training

Config Value
seq length 1024
weight decay 0.1
learning rate 0.0005
max eval steps -1
shuffle buffer 10000
max train steps 150000
mixed precision fp16
num warmup steps 2000
train batch size 5
valid batch size 5
lr scheduler type cosine
save checkpoint steps 15000
gradient checkpointing false
gradient accumulation steps 1

Resources

Resources used for research:

Downloads last month
28
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Datasets used to train mvasiliniuc/iva-codeint-swift-small