-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
base: main
Are you sure you want to change the base?
Conversation
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 |
document_object = nlp(text_description) | ||
|
||
for entity in document_object.ents: | ||
print(f"{entity.text}, ({entity.label_})") |
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.
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: |
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.
Remove this
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.
@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)
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.
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) |
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.
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
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.
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!
@Jonathan-Sendsen we can run StableDiffusion in the browser with https://islamov.ai/stable-diffusion-webgpu/ |
This PR implements a logo generator as per #262