mirror of
https://codeberg.org/hyperreal/gen-alt-text
synced 2025-01-18 16:53:43 +01:00
Check for vision model
This commit is contained in:
parent
b601b2c381
commit
5e6a01ce16
@ -11,6 +11,18 @@ Options:
|
|||||||
-m MODEL Use MODEL as the model. If MODEL is not provided, it defaults
|
-m MODEL Use MODEL as the model. If MODEL is not provided, it defaults
|
||||||
to llama3.2-vision:11b.
|
to llama3.2-vision:11b.
|
||||||
|
|
||||||
|
Supported vision models:
|
||||||
|
- llama3.2-vision:11b
|
||||||
|
- llama3.2-vision:90b
|
||||||
|
- llava:7b
|
||||||
|
- llava:13b
|
||||||
|
- llava:34b
|
||||||
|
- llava-llama3:8b
|
||||||
|
- bakllava:7b
|
||||||
|
- moondream:1.8b
|
||||||
|
- llava-phi3:3.8b
|
||||||
|
- minicpm-v:8b
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
gen-alt-text -m llama3.2-vision:90b ~/pictures/rubber_duck.jpg
|
gen-alt-text -m llama3.2-vision:90b ~/pictures/rubber_duck.jpg
|
||||||
gen-alt-text ~/pictures/coffee.jpg
|
gen-alt-text ~/pictures/coffee.jpg
|
||||||
@ -26,8 +38,35 @@ from rich.markdown import Markdown
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
args = docopt(__doc__)
|
args = docopt(__doc__)
|
||||||
|
vision_models = [
|
||||||
|
"llama3.2-vision:11b",
|
||||||
|
"llama3.2-vision:90b",
|
||||||
|
"llava:7b",
|
||||||
|
"llava:13b",
|
||||||
|
"llava:34b",
|
||||||
|
"llava-llama3:8b",
|
||||||
|
"bakllava:7b",
|
||||||
|
"moondream:1.8b",
|
||||||
|
"llava-phi3:3.8b",
|
||||||
|
"minicpm-v:8b",
|
||||||
|
]
|
||||||
|
|
||||||
|
print()
|
||||||
|
console = Console()
|
||||||
|
|
||||||
if args["-m"]:
|
if args["-m"]:
|
||||||
model = args["-m"]
|
if args["-m"] not in vision_models:
|
||||||
|
console.print(
|
||||||
|
"You must use a vision model to generate alt-text from images."
|
||||||
|
)
|
||||||
|
print()
|
||||||
|
console.print("[bold magenta]Available vision models:[/bold magenta]")
|
||||||
|
for model in vision_models:
|
||||||
|
print(f"- {model}")
|
||||||
|
print()
|
||||||
|
exit("Select a model above and run the command again.")
|
||||||
|
else:
|
||||||
|
model = args["-m"]
|
||||||
else:
|
else:
|
||||||
model = "llama3.2-vision:11b"
|
model = "llama3.2-vision:11b"
|
||||||
|
|
||||||
@ -36,8 +75,6 @@ def main():
|
|||||||
else:
|
else:
|
||||||
client = Client(host="http://localhost:11434")
|
client = Client(host="http://localhost:11434")
|
||||||
|
|
||||||
print()
|
|
||||||
console = Console()
|
|
||||||
try:
|
try:
|
||||||
with console.status(
|
with console.status(
|
||||||
f"[bold magenta] {model}[/bold magenta] is generating alt-text for "
|
f"[bold magenta] {model}[/bold magenta] is generating alt-text for "
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "gen-alt-text"
|
name = "gen-alt-text"
|
||||||
version = "0.1"
|
version = "0.2"
|
||||||
authors = [
|
authors = [
|
||||||
{ name="Jeffrey Serio", email="hyperreal@fedoraproject.org" },
|
{ name="Jeffrey Serio", email="hyperreal@fedoraproject.org" },
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user