Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,10 +4,9 @@ from sklearn.metrics.pairwise import cosine_similarity
|
|
4 |
import torch
|
5 |
import numpy as np
|
6 |
from gradio_client import Client
|
7 |
-
|
8 |
-
# Cache the model and tokenizer using lru_cache
|
9 |
from functools import lru_cache
|
10 |
|
|
|
11 |
@lru_cache(maxsize=1)
|
12 |
def load_model_and_tokenizer():
|
13 |
model_name = "./all-MiniLM-L6-v2" # Replace with your Space and model path
|
@@ -99,4 +98,4 @@ interface = gr.Interface(
|
|
99 |
description="Translate text from English to French with optimized context detection."
|
100 |
)
|
101 |
|
102 |
-
interface.launch()
|
|
|
4 |
import torch
|
5 |
import numpy as np
|
6 |
from gradio_client import Client
|
|
|
|
|
7 |
from functools import lru_cache
|
8 |
|
9 |
+
# Cache the model and tokenizer using lru_cache
|
10 |
@lru_cache(maxsize=1)
|
11 |
def load_model_and_tokenizer():
|
12 |
model_name = "./all-MiniLM-L6-v2" # Replace with your Space and model path
|
|
|
98 |
description="Translate text from English to French with optimized context detection."
|
99 |
)
|
100 |
|
101 |
+
interface.launch()
|