Image-to-Text
PEFT
Safetensors
Portuguese
English
vision-language
table-extraction
scientific-figures
markdown-table
qwen2.5-vl
lora
icdar-metric-loss
Instructions to use lucasoc/sci-image-models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use lucasoc/sci-image-models with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-VL-3B-Instruct") model = PeftModel.from_pretrained(base_model, "lucasoc/sci-image-models") - Notebooks
- Google Colab
- Kaggle
Download src/utils/config.py from lucasoc/sci-image-models: direct link, hf CLI and curl.
- Browser
- Download file 917 Bytes
-
https://huggingface.co/lucasoc/sci-image-models/resolve/main/src/utils/config.py
- Command line
-
hf download hf://lucasoc/sci-image-models/src/utils/config.py
-
curl -L -o config.py https://huggingface.co/lucasoc/sci-image-models/resolve/main/src/utils/config.py
917 Bytes
| """ | |
| Configuration management utilities. | |
| """ | |
| import os | |
| from typing import Any, Dict, Optional | |
| import yaml | |
| def load_config(config_path: str) -> Dict[str, Any]: | |
| """Load a YAML configuration file.""" | |
| if not os.path.exists(config_path): | |
| raise FileNotFoundError(f"Configuration file not found: {config_path}") | |
| with open(config_path, "r", encoding="utf-8") as f: | |
| return yaml.safe_load(f) or {} | |
| def merge_configs(base: Dict[str, Any], override: Optional[Dict[str, Any]]) -> Dict[str, Any]: | |
| """Deep merge two dictionaries, where override takes precedence.""" | |
| if not override: | |
| return base.copy() | |
| result = base.copy() | |
| for key, value in override.items(): | |
| if key in result and isinstance(result[key], dict) and isinstance(value, dict): | |
| result[key] = merge_configs(result[key], value) | |
| else: | |
| result[key] = value | |
| return result | |