Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
from sentence_transformers import CrossEncoder
|
3 |
-
from fastrag.utils import optimize_model
|
4 |
|
5 |
# Load and optimize the model
|
6 |
model = CrossEncoder(
|
7 |
-
"jinaai/jina-reranker-
|
8 |
trust_remote_code=True
|
9 |
)
|
10 |
|
11 |
-
# Apply Intel IPEX optimization (FastRAG)
|
12 |
-
model = optimize_model(model, backend="ipex") # ✅ Faster CPU inference
|
13 |
-
|
14 |
# Function to rerank documents
|
15 |
def rerank(query, documents):
|
16 |
documents = documents.split("&&&") # Use special delimiter
|
|
|
1 |
import gradio as gr
|
2 |
from sentence_transformers import CrossEncoder
|
|
|
3 |
|
4 |
# Load and optimize the model
|
5 |
model = CrossEncoder(
|
6 |
+
"jinaai/jina-reranker-v1-tiny-en",
|
7 |
trust_remote_code=True
|
8 |
)
|
9 |
|
|
|
|
|
|
|
10 |
# Function to rerank documents
|
11 |
def rerank(query, documents):
|
12 |
documents = documents.split("&&&") # Use special delimiter
|