-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
astria api #115
base: master
Are you sure you want to change the base?
astria api #115
Conversation
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.
- 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
|
|
||
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"]) |
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.
provider_job_id is a string not an integer
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.
fixed
} | ||
files = [] | ||
if input_image: | ||
files.append((f"tune[prompts_attributes][{i}][input_image]", load_image(input_image))) |
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.
i is not defined
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.
fixed
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) |
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.
this link doesn't work use this link instead
https://api.astria.ai/tunes/project_id/prompts
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.
fixed
} | ||
for image in files: | ||
image_data = load_image(image) # Assuming image is a file path | ||
files.append(("tune[images][]", image_data)) |
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.
Append to files which create a problem because files list already exist
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.
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), |
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.
**data can't work because difference between names
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.
fixed
'prompt[text]': prompt, | ||
'prompt[negative_prompt]': negative_prompt, | ||
'prompt[num_images]': num_images, | ||
'prompt[face_swap]': True, |
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.
If I want to create something else other than human return an error (try to create a dog)
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.
added args
added some fixes |
No description provided.