Resolves #35, resolves #59, resolves #53 (#60)

* fix: [#35] - jan containers wont restart

* chore: remove keycloak health check https://github.com/keycloak/keycloak/issues/17273

* fix: #53 hasura seeds should not yield error on conflict

* fix: #59 hasura image generation action timeout

* chore: jan web - fixes error logs of empty href url
This commit is contained in:
Louis 2023-09-05 22:00:01 +07:00 committed by GitHub
parent 86f0ffc7d1
commit 25a096da28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 23 additions and 14 deletions

View File

@ -3,6 +3,7 @@ actions:
definition:
kind: synchronous
handler: '{{HASURA_ACTION_STABLE_DIFFUSION_URL}}'
timeout: 1800
request_transform:
body:
action: transform

View File

@ -2,3 +2,4 @@ SET check_function_bodies = false;
INSERT INTO public.products ("slug", "name", "nsfw", "image_url", "description", "long_description", "technical_description", "author", "version", "source_url", "inputs", "outputs", "greeting") VALUES
('llama2', 'Llama-2-7B-Chat', 't', 'https://static-assets.jan.ai/llama2.jpg','Llama 2 is Meta`s open source large language model (LLM)', 'Llama 2 is a collection of pretrained and fine-tuned generative text models ranging in scale from 7 billion to 70 billion parameters. This is the repository for the 7B pretrained model. Links to other models can be found in the index at the bottom.', 'Meta developed and publicly released the Llama 2 family of large language models (LLMs), a collection of pretrained and fine-tuned generative text models ranging in scale from 7 billion to 70 billion parameters. Our fine-tuned LLMs, called Llama-2-Chat, are optimized for dialogue use cases. Llama-2-Chat models outperform open-source chat models on most benchmarks we tested, and in our human evaluations for helpfulness and safety, are on par with some popular closed-source models like ChatGPT and PaLM.', 'Meta', 'Llama2-7B-GGML', 'https://huggingface.co/TheBloke/airoboros-13B-gpt4-1.4-GGML', '{"body": [{"name": "messages", "type": "array", "items": [{"type": "object", "properties": [{"name": "role", "type": "string", "example": "system", "description": "Defines the role of the message."}, {"name": "content", "type": "string", "example": "Hello, world!", "description": "Contains the content of the message."}]}], "description": "An array of messages, each containing a role and content. The latest message is always at the end of the array."}, {"name": "stream", "type": "boolean", "example": true, "description": "Indicates whether the client wants to keep the connection open for streaming."}, {"name": "max_tokens", "type": "integer", "example": 500, "description": "Defines the maximum number of tokens that the client wants to receive."}], "slug": "llm", "headers": {"accept": "text/event-stream", "content-type": "application/json"}}', '{"slug": "llm", "type": "object", "properties": [{"name": "id", "type": "string", "example": "chatcmpl-4c4e5eb5-bf53-4dbc-9136-1cf69fc5fd7c", "description": "The unique identifier of the chat completion chunk."}, {"name": "model", "type": "string", "example": "gpt-3.5-turbo", "description": "The name of the GPT model used to generate the completion."}, {"name": "created", "type": "integer", "example": 1692169988, "description": "The Unix timestamp representing the time when the completion was generated."}, {"name": "object", "type": "string", "example": "chat.completion.chunk", "description": "A string indicating the type of the chat completion chunk."}, {"name": "choices", "type": "array", "items": [{"type": "object", "properties": [{"name": "index", "type": "integer", "example": 0, "description": "The index of the choice made by the GPT model."}, {"name": "delta", "type": "object", "properties": [{"name": "content", "type": "string", "example": "What", "description": "The content generated by the GPT model."}], "description": "A JSON object containing the content generated by the GPT model."}, {"name": "finish_reason", "type": "string", "example": null, "description": "A string indicating why the GPT model stopped generating content."}]}], "description": "An array containing the choices made by the GPT model to generate the completion."}], "description": "A JSON object representing a chat completion chunk."}', '👋Im a versatile AI trained on a wide range of topics, here to answer your questions about the universe. What are you curious about today?'),
('stablediffusion', 'Stable-Diffusion-v1.5', 't', 'https://static-assets.jan.ai/stablediffusion.jpg', 'Stable Diffusion is a latent text-to-image diffusion model capable of generating photo-realistic images given any text input.', 'The Stable-Diffusion-v1-5 checkpoint was initialized with the weights of the Stable-Diffusion-v1-2 checkpoint and subsequently fine-tuned on 595k steps at resolution 512x512 on "laion-aesthetics v2 5+" and 10% dropping of the text-conditioning to improve classifier-free guidance sampling.', 'This is a model that can be used to generate and modify images based on text prompts. It is a Latent Diffusion Model that uses a fixed, pretrained text encoder (CLIP ViT-L/14) as suggested in the Imagen paper.', 'runwayml', '4.0.0', 'https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors', '{"body": [{"name": "prompt", "type": "string", "description": "Input prompt"}, {"name": "negative_prompt", "type": "string", "description": "Specify things to not see in the output"}, {"name": "width", "type": "integer", "description": "Width of output image. Maximum size is 1024x768 or 768x1024 because of memory limits"}, {"name": "height", "type": "integer", "description": "Height of output image. Maximum size is 1024x768 or 768x1024 because of memory limits"}, {"name": "num_outputs", "type": "integer", "description": "Number of images to output. (minimum: 1; maximum: 4)"}, {"name": "num_inference_steps", "type": "integer", "description": "Number of denoising steps (minimum: 1; maximum: 500)"}, {"name": "guidance_scale", "type": "integer", "description": "Scale for classifier-free guidance (minimum: 1; maximum: 20)"}], "slug": "sd", "headers": {"accept": "application/json", "content-type": "multipart/form-data"}}', '{"slug": "sd", "type": "object", "properties": [{"name": "url", "type": "string", "description": "The unique identifier of the chat completion chunk."}], "description": "URL result image."}', 'Hello there 👋')
ON CONFLICT (slug) DO NOTHING;

View File

@ -1,4 +1,5 @@
SET check_function_bodies = false;
INSERT INTO public.collections ("slug", "name", "description") VALUES
('conversational', 'Conversational', 'Chatbot alternatives to ChatGPT. Converse with these models and get answers.'),
('text-to-image', 'Text to image', 'Converse with these models to generate images.');
('text-to-image', 'Text to image', 'Converse with these models to generate images.')
ON CONFLICT (slug) DO NOTHING;

View File

@ -3,9 +3,9 @@ SET check_function_bodies = false;
INSERT INTO public.collection_products (collection_id, product_id)
SELECT (SELECT id FROM public.collections WHERE slug = 'conversational') AS collection_id, id AS product_id
FROM public.products
WHERE slug IN ('llama2');
WHERE slug IN ('llama2') ON CONFLICT (collection_id, product_id) DO NOTHING;;
INSERT INTO public.collection_products (collection_id, product_id)
SELECT (SELECT id FROM public.collections WHERE slug = 'text-to-image') AS collection_id, id AS product_id
FROM public.products
WHERE slug IN ('stablediffusion');
WHERE slug IN ('stablediffusion') ON CONFLICT (collection_id, product_id) DO NOTHING;

View File

@ -13,4 +13,5 @@ INSERT INTO public.prompts ("slug", "content", "image_url") VALUES
('openjourney-pocahontas', 'mdjrny-v4 style portrait photograph of Madison Beer as Pocahontas, young beautiful native american woman, perfect symmetrical face, feather jewelry, traditional handmade dress, armed female hunter warrior, (((wild west))) environment, Utah landscape, ultra realistic, concept art, elegant, ((intricate)), ((highly detailed)), depth of field, ((professionally color graded)), 8k, art by artgerm and greg rutkowski and alphonse mucha', 'https://static-assets.jan.ai/openjourney-1.jpeg'),
('text2image-gray-dog-eyes', 'realistic portrait of an gray dog, bright eyes, radiant and ethereal intricately detailed photography, cinematic lighting, 50mm lens with bokeh', 'https://static-assets.jan.ai/openjourney-7.jpeg'),
('text2image-ogre-exoskeleton', 'mdjrny-v4 style OGRE is wearing a powered exoskeleton , long horn, , cute face, tsutomu nihei style, Claude Monet, banksy art, 8K, Highly Detailed, Dramatic Lighting, high quality, ray of god, explosion, lens flare, beautiful detailed sky, cinematic lighting, overexposure, quality, colorful, hdr, concept design, photorealistic, hyper real, Alphonse Mucha, Pixar, cyberpunk 2077, masterpiece, the best quality, super fine illustrations, beatiful detailed cyberpunk city, extremely detailed eyes and face, beatiful detailed hair, wavy hair,beatiful detailed steet,mecha clothes, robot girl, bodysuit, very delicate light, fine lighting, very fine 8KCG wallpapers, plateau, sunrise, overexposure, randomly distributed clouds, cliff, rotating star sky, lake in mountain stream, luminous particles , Unreal Engine5, 8K', 'https://static-assets.jan.ai/openjourney-6.jpeg'),
('text2image-pablo-picasso', 'a young caucasian man holding his chin.pablo picasso style, acrylic painting, trending on pixiv fanbox, palette knife and brush. strokes,', 'https://static-assets.jan.ai/openjourney-5.jpeg');
('text2image-pablo-picasso', 'a young caucasian man holding his chin.pablo picasso style, acrylic painting, trending on pixiv fanbox, palette knife and brush. strokes,', 'https://static-assets.jan.ai/openjourney-5.jpeg')
ON CONFLICT (slug) DO NOTHING;

View File

@ -8,7 +8,7 @@ ON (p.id
IN (SELECT x.id FROM public.products x INNER JOIN public.collection_products y ON x.id = y.product_id
INNER JOIN public.collections z ON y.collection_id = z.id
WHERE z.slug = 'text-to-image'))
WHERE r.image_url IS NOT NULL AND r.image_url != '';
WHERE r.image_url IS NOT NULL AND r.image_url != '' ON CONFLICT (product_id, prompt_id) DO NOTHING;
INSERT INTO public.product_prompts (product_id, prompt_id)
SELECT p.id AS product_id, r.id AS prompt_id
@ -18,4 +18,4 @@ ON (p.id
IN (SELECT x.id FROM public.products x INNER JOIN public.collection_products y ON x.id = y.product_id
INNER JOIN public.collections z ON y.collection_id = z.id
WHERE z.slug = 'conversational'))
WHERE r.image_url IS NULL OR r.image_url = '';
WHERE r.image_url IS NULL OR r.image_url = '' ON CONFLICT (product_id, prompt_id) DO NOTHING;

View File

@ -1,8 +1,8 @@
NEXT_PUBLIC_ENV=development
NEXT_PUBLIC_WEB_URL=
NEXT_PUBLIC_DISCORD_INVITATION_URL=
NEXT_PUBLIC_DOWNLOAD_APP_IOS=
NEXT_PUBLIC_DOWNLOAD_APP_ANDROID=
NEXT_PUBLIC_WEB_URL=http://localhost:3000
NEXT_PUBLIC_DISCORD_INVITATION_URL=#
NEXT_PUBLIC_DOWNLOAD_APP_IOS=#
NEXT_PUBLIC_DOWNLOAD_APP_ANDROID=#
KEYCLOAK_CLIENT_ID=hasura
KEYCLOAK_CLIENT_SECRET=oMtCPAV7diKpE564SBspgKj4HqlKM4Hy
AUTH_ISSUER=http://localhost:8088/realms/hasura

View File

@ -56,11 +56,13 @@ services:
depends_on:
data-connector-agent:
condition: service_healthy
keycloak:
condition: service_started
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/healthz"]
interval: 30s
interval: 5s
timeout: 10s
retries: 10
retries: 30
labels:
- "traefik.enable=true"
- "traefik.http.routers.graphql-engine.entrypoints=jan"
@ -147,6 +149,9 @@ services:
- "traefik.http.routers.web.rule=(Host(`localhost`) && PathPrefix(`/web`))"
- "traefik.http.routers.web.middlewares=rewritepath"
- "traefik.http.middlewares.rewritepath.addprefix.prefix=/web"
depends_on:
graphql-engine:
condition: service_healthy
networks:
jan_community:
ipv4_address: 172.20.0.15

View File

@ -21,7 +21,7 @@ const MobileDownload = () => {
{/** Buttons */}
<div className="flex w-full mt-4 justify-between">
<a
href={process.env.NEXT_PUBLIC_DOWNLOAD_APP_IOS || ""}
href={process.env.NEXT_PUBLIC_DOWNLOAD_APP_IOS || "#"}
target="_blank"
rel="noopener noreferrer"
className="w-[48%]"
@ -42,7 +42,7 @@ const MobileDownload = () => {
</a>
<a
href={process.env.NEXT_PUBLIC_DOWNLOAD_APP_ANDROID || ""}
href={process.env.NEXT_PUBLIC_DOWNLOAD_APP_ANDROID || "#"}
target="_blank"
rel="noopener noreferrer"
className="w-[48%]"