From 41d355b25344a615b0ccbabdfdb0977a2651da94 Mon Sep 17 00:00:00 2001 From: Gene Kogan Date: Fri, 5 Apr 2024 11:38:10 -0700 Subject: [PATCH 1/2] fix huemin --- logos/creation_interfaces/kojii_huemin.py | 24 ++++------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/logos/creation_interfaces/kojii_huemin.py b/logos/creation_interfaces/kojii_huemin.py index 7bcc9d3..616a41a 100644 --- a/logos/creation_interfaces/kojii_huemin.py +++ b/logos/creation_interfaces/kojii_huemin.py @@ -174,9 +174,11 @@ def generate_prompt(selected_climate, selected_landform, selected_body_of_water) selected_structure = ( random.choice(list(Structure)).value if random.random() < 0.20 else "" ) - selected_season = random.choice(list(Season)).value if random() < 0.95 else "" + selected_season = ( + random.choice(list(Season)).value if random.random() < 0.95 else "" + ) # selected_time_of_day = random.choice(list(TimeOfDay)).value - selected_colors = random.choice(list(Color)).value if random() < 0.95 else "" + selected_colors = random.choice(list(Color)).value if random.random() < 0.95 else "" selected_keywords = [ selected_climate.value, @@ -212,21 +214,3 @@ def kojii_huemin(request: KojiiHueminRequest, callback=None): image_url, thumbnail_url = replicate.sdxl(config) return image_url, thumbnail_url - - -def kojii_huemin(request: KojiiHueminRequest, callback=None): - print("HUMIN REQUEST") - print(request) - prompt = generate_prompt(request.climate, request.landform, request.body_of_water) - seed = request.seed if request.seed else random.randint(0, 1000000) - print(prompt) - - config = { - "mode": "kojii/huemin", - "text_input": prompt, - "seed": seed, - } - - image_url, thumbnail_url = replicate.sdxl(config) - - return image_url, thumbnail_url From 863ede451d9215de58538c5a2646189470b7078c Mon Sep 17 00:00:00 2001 From: Gene Kogan Date: Fri, 5 Apr 2024 11:39:25 -0700 Subject: [PATCH 2/2] test --- test.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test.py diff --git a/test.py b/test.py new file mode 100644 index 0000000..3566c89 --- /dev/null +++ b/test.py @@ -0,0 +1,25 @@ +from logos.llm import LLM +from pydantic import BaseModel + + +class OutputSchema(BaseModel): + """ + Output schema for LLM + """ + + description: str + numimages: int + + +llm = LLM(model="gpt-4-1106-preview", system_message="You are an AI assistant") + +prompt = "Describe this image. In description, tell me what the image is about. In numimages, tell me how many images are attached." + +result = llm( + prompt, + image="https://edenartlab-prod-data.s3.us-east-1.amazonaws.com/27d5f97d76bb6550cec0f82296587bbc1ac1d66d34cfa824f3056046abe8c0e1.jpg", + output_schema=OutputSchema, + params={"max_tokens": 1000}, +) + +print(result)