Skip to content

Commit 3a8b9a5

Browse files
authored
Adding Rust example querying image with text (#145)
* Adding example querying image with text * Fix README
1 parent b6a1769 commit 3a8b9a5

File tree

16 files changed

+1914
-6
lines changed

16 files changed

+1914
-6
lines changed

.github/workflows/test.yml

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ jobs:
6161

6262
run-python-tests:
6363
if: always()
64-
# needs: ["run-rust-tests"]
6564
runs-on: ubuntu-latest
6665

6766
steps:

ahnlich/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ run-db-tracing: ## Run ahnlich_db bin with tracing enabled
4848
cargo run --bin ahnlich-db run --enable-tracing
4949

5050
run-ai: ## Run ahnlich_ai bin with default supported models
51-
cargo run --bin ahnlich-ai run --supported-models all-minilm-l6-v2,resnet-50,bge-base-en-v1.5
51+
cargo run --bin ahnlich-ai run --supported-models all-minilm-l6-v2,resnet-50,bge-base-en-v1.5,clip-vit-b32-text,clip-vit-b32-image
5252

5353
run-ai-tracing: ## Run ahnlich_ai bin with default supported models and tracing_enabled
5454
cargo run --bin ahnlich-ai run --supported-models all-minilm-l6-v2,resnet-50 --enable-tracing

ahnlich/ai/src/engine/store.rs

+3
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ impl AIStoreHandler {
237237
preprocess_action: PreprocessAction,
238238
) -> Result<StoreSetResponse, AIProxyError> {
239239
let store = self.get(store_name)?;
240+
if inputs.is_empty() {
241+
return Ok((vec![], None));
242+
}
240243
let (validated_data, delete_hashset) =
241244
self.validate_and_prepare_store_data(store_name, inputs)?;
242245

ahnlich/client/src/conn/ai.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pub struct AIConn {
1111

1212
impl AIConn {
1313
pub(crate) async fn new(host: &str, port: u16) -> Result<Self, AhnlichError> {
14-
println!("Creating pool with {host}:{port}");
1514
let stream = TcpStream::connect(format!("{host}:{port}")).await?;
1615
Ok(Self { stream })
1716
}

ahnlich/client/src/conn/db.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pub struct DBConn {
1111

1212
impl DBConn {
1313
pub(crate) async fn new(host: &str, port: u16) -> Result<Self, AhnlichError> {
14-
println!("Creating pool with {host}:{port}");
1514
let stream = TcpStream::connect(format!("{host}:{port}")).await?;
1615
Ok(Self { stream })
1716
}

examples/python/book-search/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Book search example for Python SDK
22

3-
An example on how to use the python sdk that shows the process fo splitting and
3+
An example on how to use the python sdk that shows the process of splitting and
44
inserting an epub ebook into the db and querying it via a search phrase either directly or contextually
55

66
To install dependencies (ensure you have poetry installed)
@@ -16,4 +16,4 @@ To search run
1616

1717
![insertion gif](searchphrase.gif)
1818

19-
Note that the epub file being split _(Animal Farm by George Orwell)_ is available locally in the example file and the example can be editted to customize processes and play around with input and output.
19+
Note that the epub file being split _(Animal Farm by George Orwell)_ is available locally in the example file and the example can be editted to customize processes and play around with input and output.

0 commit comments

Comments
 (0)