-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat: initial image generation support #1095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
02bfd7b to
0783aaf
Compare
| model_card = MODEL_CARDS[model_id] | ||
| return model_card | ||
|
|
||
| for _, model_card in MODEL_CARDS.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opinion, not functionality - we should change the MODEL_CARDS to be keyed by model_id and drop the model_id field from them. the short ids are confusing.
| user: str | None = None | ||
|
|
||
|
|
||
| class ImageEditsTaskParams(BaseModel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential / TODO / your discretion: OpenAI API compat here.
| ) | ||
|
|
||
| self.command_task_mapping[command.command_id] = task_id | ||
| case ImageGeneration(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you mentioned, seems the most generic code - ideally we'd delegate to a load balancer here I suppose.
| n: int | None = 1 | ||
| quality: Literal["high", "medium", "low"] | None = "medium" | ||
| output_format: Literal["png", "jpeg", "webp"] = "png" | ||
| response_format: Literal["url", "b64_json"] | None = "b64_json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't support url
| from pathlib import Path | ||
| from typing import Callable, Literal | ||
| from urllib.parse import urljoin | ||
| from huggingface_hub._snapshot_download import snapshot_download |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private download?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't say I'm a huge fan, but that's all of download_utils.
| from exo.worker.runner.bootstrap import logger | ||
|
|
||
|
|
||
| class DistributedImageModel: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok surely this should actually be a dataclass
src/exo/worker/plan.py
Outdated
| if ( | ||
| not isinstance(task, ChatCompletion) | ||
| and not isinstance(task, ImageGeneration) | ||
| and not isinstance(task, ImageEdits) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not isinstance(task, (ChatCompletion, ImageGeneration, ImageEdits)) works
|
We've discussed plenty, my review is mostly to submit comments that are mainly stylistic. My main aims are to standardise what data we use to shard and parallelise and evaluate model scheduling and placement. |
791bbb1 to
3a579cc
Compare
ad5703f to
b644490
Compare
b644490 to
29191b0
Compare
d3c1e6a to
01148d5
Compare
0fa5f0f to
5ac44a0
Compare
2668c6c to
a315e68
Compare
cad4502 to
4519548
Compare
c1fb4a5 to
04cd02b
Compare
Motivation
Changes
Why It Works
Test Plan
Manual Testing
Automated Testing