Skip to content

Dan rag update #1549

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

Merged
merged 4 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update editor db and query
  • Loading branch information
chillenberger committed Jul 9, 2024
commit 3ca43ed746380669fac69a2426dfdbae720e8896
2 changes: 1 addition & 1 deletion pgml-dashboard/src/api/code_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn get_readonly_pool() -> PgPool {
.max_connections(1)
.idle_timeout(std::time::Duration::from_millis(60_000))
.max_lifetime(std::time::Duration::from_millis(60_000))
.connect_lazy(&std::env::var("CHATBOT_DATABASE_URL").expect("CHATBOT_DATABASE_URL not set"))
.connect_lazy(&std::env::var("EDITOR_DATABASE_URL").expect("EDITOR_DATABASE_URL not set"))
.expect("could not build lazy database connection")
})
.clone()
Expand Down
4 changes: 2 additions & 2 deletions pgml-dashboard/static/js/utilities/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const generateSql = (task, model, userInput) => {
);`;
} else if (task === "embedded-query") {
return `WITH embedded_query AS (
SELECT pgml.embed ('Alibaba-NLP/gte-base-en-v1.5', '${userInput}')::vector embedding
SELECT pgml.embed('mixedbread-ai/mxbai-embed-large-v1', 'What is Postgres?', '{"prompt": "Represent this sentence for searching relevant passages: "}'::JSONB)::vector embedding
),
context_query AS (
SELECT chunks.chunk FROM chunks
Expand All @@ -42,7 +42,7 @@ SELECT
"task": "conversational",
"model": "meta-llama/Meta-Llama-3-8B-Instruct"
}'::jsonb,
inputs => ARRAY['{"role": "system", "content": "You are a friendly and helpful chatbot."}'::jsonb, replace('{"role": "user", "content": "Given the context answer the following question. ${userInput}? Context:\n\n{CONTEXT}"}', '{CONTEXT}', chunk)::jsonb],
inputs => ARRAY['{"role": "system", "content": "You are a friendly and helpful chatbot."}'::jsonb, jsonb_build_object('role', 'user', 'content', replace('Given the context answer the following question. What is Postgres? Context:\n{CONTEXT}', '{CONTEXT}', chunk))],
args => '{
"max_new_tokens": 100
}'::jsonb
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy