Skip to content
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

astria api #115

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

astria api #115

wants to merge 4 commits into from

Conversation

burgalon
Copy link

No description provided.

Copy link
Contributor

@Tristoun Tristoun left a 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

@burgalon
Copy link
Author

burgalon commented Feb 2, 2024

  1. Pending
  2. Provider_job_id is used indeed as much as I can see
  3. Not sure what you mean by that
  4. Can you be more specific to the line of where you're seeing an infinite loop posibility?
  5. added base_tune_id
  6. class_name is indeed an argument and allows any class, and is not limited to man/woman
  7. Fixed


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"])
Copy link
Contributor

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

Copy link
Author

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)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i is not defined

Copy link
Author

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)
Copy link
Contributor

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

Copy link
Author

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))
Copy link
Contributor

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

Copy link
Author

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),
Copy link
Contributor

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

Copy link
Author

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,
Copy link
Contributor

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)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added args

@burgalon
Copy link
Author

burgalon commented Feb 2, 2024

added some fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants