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

Contrib/logogenerator #378

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Contrib/logogenerator #378

wants to merge 3 commits into from

Conversation

Jonathan-Sendsen
Copy link
Collaborator

This PR implements a logo generator as per #262

@cr-gpt
Copy link

cr-gpt bot commented Jul 11, 2023

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@Jonathan-Sendsen Jonathan-Sendsen marked this pull request as draft July 11, 2023 20:27
document_object = nlp(text_description)

for entity in document_object.ents:
print(f"{entity.text}, ({entity.label_})")
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to print, just return the relevant entities.

Also, please move this function to main.py and name it get_entities. It should also accept a string as an argument.

response = requests.get(endpoint, auth=auth)
logger.info(f"response=\n{pformat(response.json())}")

if 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@abrichr just a question. Why remove all this code? The if 0 part I understand why. However, the response =... isn't that used for the endpoint to get data from the noun project based on the API key?

Additionally, logger.info... I think I understand why that needs to be removed since this gets the request and prints it to the logs (for debugging purposes)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nevermind I think I know why we need to remove all of this because the blacklist function will send a get request on behalf of the app.

auth = OAuth1(key, secret)
endpoint = "https://api.thenounproject.com/v2/icon/1"

response = requests.get(endpoint, auth=auth)
Copy link
Contributor

Choose a reason for hiding this comment

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

Consult the noun project API to determine which URL to use in order to search, and search for each of the entities returned by get_entities

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good 👍 based on my current research I think we should use their blacklist endpoint. It allows for more control over their icons relatively compared to their other APIs.

The blacklist API is pretty neat if there are irrelevant or inappropriate terms. They will automatically be excluded compared to their icons endpoint.

I'll have some stuff for us to chat about on Friday!

@abrichr
Copy link
Contributor

abrichr commented Jul 18, 2023

@Jonathan-Sendsen we can run StableDiffusion in the browser with https://islamov.ai/stable-diffusion-webgpu/

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