Open
Conversation
Tristoun
suggested changes
Jan 30, 2024
Contributor
There was a problem hiding this comment.
- Catch errors by raising a ProviderException if the response status is not good, instead of using raise for status.
- Utilize strings for the provider_job_id.
- Change the url when create a job with image__generate.
- Resolve the infinite loop in tune creation caused by multiple "files."
- Allow users to use a base_tune_id other than 690204.
- Enable users to create entities other than just "man" or "woman."
- Resolve issue with **data, doens't work because of differences between names
Author
|
Tristoun
suggested changes
Feb 2, 2024
|
|
||
| response = requests.post(f"{self.url}tunes", data=data, files=files, headers=self.headers) | ||
| response.raise_for_status() | ||
| return AsyncLaunchJobResponseType(provider_job_id=response.json()["id"]) |
Contributor
There was a problem hiding this comment.
provider_job_id is a string not an integer
| } | ||
| files = [] | ||
| if input_image: | ||
| files.append((f"tune[prompts_attributes][{i}][input_image]", load_image(input_image))) |
| if input_image: | ||
| files.append((f"tune[prompts_attributes][{i}][input_image]", load_image(input_image))) | ||
|
|
||
| response = requests.post(f"{self.url}/tunes/{project_id}", headers=self.headers, data=data) |
Contributor
There was a problem hiding this comment.
this link doesn't work use this link instead
https://api.astria.ai/tunes/project_id/prompts
| } | ||
| for image in files: | ||
| image_data = load_image(image) # Assuming image is a file path | ||
| files.append(("tune[images][]", image_data)) |
Contributor
There was a problem hiding this comment.
Append to files which create a problem because files list already exist
Author
There was a problem hiding this comment.
indeed, and that's a good thing :)
| status="succeeded" if data['trained_at'] else "pending", | ||
| provider_job_id=provider_job_id, | ||
| original_response=data, | ||
| standardized_response=GenerationFineTuningGenerateImageAsyncDataClass(**data), |
Contributor
There was a problem hiding this comment.
**data can't work because difference between names
| 'prompt[text]': prompt, | ||
| 'prompt[negative_prompt]': negative_prompt, | ||
| 'prompt[num_images]': num_images, | ||
| 'prompt[face_swap]': True, |
Contributor
There was a problem hiding this comment.
If I want to create something else other than human return an error (try to create a dog)
Author
|
added some fixes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.