Skip to content

Commit 15c2d24

Browse files
authored
Merge pull request #14 from postgresml/silas-update-open-source-ai
Updated open source ai
2 parents bce269a + 40736a8 commit 15c2d24

File tree

4 files changed

+16
-61
lines changed

4 files changed

+16
-61
lines changed

korvus/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "korvus"
3-
version = "1.1.1"
3+
version = "1.1.2"
44
edition = "2021"
55
authors = ["PosgresML <[email protected]>"]
66
homepage = "https://postgresml.org/"

korvus/javascript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "korvus",
3-
"version": "1.1.3",
3+
"version": "1.1.4",
44
"description": "Open Source Alternative for Building End-to-End Vector Search Applications without OpenAI & Pinecone",
55
"keywords": [
66
"postgres",

korvus/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "maturin"
55
[project]
66
name = "korvus"
77
requires-python = ">=3.7"
8-
version = "1.1.1"
8+
version = "1.1.2"
99
description = "Python SDK is designed to facilitate the development of scalable vector search applications on PostgreSQL databases."
1010
authors = [
1111
{name = "PostgresML", email = "[email protected]"},

korvus/src/open_source_ai.rs

Lines changed: 13 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -28,55 +28,6 @@ pub struct OpenSourceAI {
2828
database_url: Option<String>,
2929
}
3030

31-
fn try_model_nice_name_to_model_name_and_parameters(
32-
model_name: &str,
33-
) -> Option<(&'static str, Json)> {
34-
match model_name {
35-
"meta-llama/Meta-Llama-3-8B-Instruct" => Some((
36-
"meta-llama/Meta-Llama-3-8B-Instruct",
37-
serde_json::json!({
38-
"task": "conversational",
39-
"model": "meta-llama/Meta-Llama-3-8B-Instruct"
40-
})
41-
.into(),
42-
)),
43-
"meta-llama/Meta-Llama-3-70B-Instruct" => Some((
44-
"meta-llama/Meta-Llama-3-70B-Instruct",
45-
serde_json::json!({
46-
"task": "conversational",
47-
"model": "meta-llama/Meta-Llama-3-70B-Instruct"
48-
})
49-
.into(),
50-
)),
51-
"microsoft/Phi-3-mini-128k-instruct" => Some((
52-
"microsoft/Phi-3-mini-128k-instruct",
53-
serde_json::json!({
54-
"task": "conversational",
55-
"model": "microsoft/Phi-3-mini-128k-instruct"
56-
})
57-
.into(),
58-
)),
59-
"mistralai/Mixtral-8x7B-Instruct-v0.1" => Some((
60-
"mistralai/Mixtral-8x7B-Instruct-v0.1",
61-
serde_json::json!({
62-
"task": "conversational",
63-
"model": "mistralai/Mixtral-8x7B-Instruct-v0.1"
64-
})
65-
.into(),
66-
)),
67-
"mistralai/Mistral-7B-Instruct-v0.2" => Some((
68-
"mistralai/Mistral-7B-Instruct-v0.2",
69-
serde_json::json!({
70-
"task": "conversational",
71-
"model": "mistralai/Mistral-7B-Instruct-v0.2"
72-
})
73-
.into(),
74-
)),
75-
76-
_ => None,
77-
}
78-
}
79-
8031
struct AsyncToSyncJsonIterator(std::pin::Pin<Box<dyn Stream<Item = anyhow::Result<Json>> + Send>>);
8132

8233
impl Iterator for AsyncToSyncJsonIterator {
@@ -141,21 +92,25 @@ impl OpenSourceAI {
14192
let model_name = model
14293
.as_str()
14394
.context("`model` must either be a string or an object")?;
144-
let (real_model_name, parameters) =
145-
try_model_nice_name_to_model_name_and_parameters(model_name).context(
146-
r#"Please select one of the provided models:
147-
mistralai/Mistral-7B-v0.1
148-
"#,
149-
)?;
15095
Ok((
15196
TransformerPipeline::new(
15297
"conversational",
153-
real_model_name,
154-
Some(parameters.clone()),
98+
model_name,
99+
Some(
100+
serde_json::json!({
101+
"task": "conversational",
102+
"model": model_name
103+
})
104+
.into(),
105+
),
155106
self.database_url.clone(),
156107
),
157108
model_name.to_string(),
158-
parameters,
109+
serde_json::json!({
110+
"task": "conversational",
111+
"model": model_name
112+
})
113+
.into(),
159114
))
160115
}
161116
}

0 commit comments

Comments
 (0)