Visual Question Answering
Transformers
Safetensors
fga
visual-dialog
visdial
multimodal
attention
factor-graph-attention
Eval Results (legacy)
Run this model with HF Jobs
Run Idan/fga 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 to fine-tune https://huggingface.co/Idan/fga. 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/Idan/fga 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.
Instructions to use Idan/fga with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Idan/fga with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "visual-question-answering" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("visual-question-answering", model="Idan/fga")# pip install -U transformers accelerate # Load model directly from transformers import FGAForVisualDialog model = FGAForVisualDialog.from_pretrained("Idan/fga", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Add Factor Graph Attention weights (VisDial v1.0, MRR 66.01)
Browse files140 unmodified lines141142143144145146147148149150151152140 unmodified linesattention = FactorGraphAttention(embed_dims=[512, 2048], num_entities=[20, 36])pooled_text, pooled_image = attention(text, image)# or declared by name, with a repeated modality sharing factor weightsattention = FactorGraphAttention.from_modalities([Modality("text", dim=512, size=20),Modality("image", dim=2048, size=36),Modality("history", dim=128, size=21, repeats=9, connected_to=("text", "image")),], use_prior=True)```The same layer backs the paper's follow-ups in140 unmodified lines141142143144145146147148149150151152153154140 unmodified linesattention = FactorGraphAttention(embed_dims=[512, 2048], num_entities=[20, 36])pooled_text, pooled_image = attention(text, image)# or declared by name, with weight sharing stated separatelyhistory = [Modality(f"history_{i}", dim=128, size=21, connected_to=("text", "image"))for i in range(1, 10)]attention = FactorGraphAttention.from_modalities([Modality("text", dim=512, size=20), Modality("image", dim=2048, size=36), *history],share_weights=[[m.name for m in history]],use_prior=True,)```The same layer backs the paper's follow-ups in
README.md+8-6