Gabriele Tuccio
commited on
Commit
Β·
b9278d3
1
Parent(s):
ce48477
update app
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import json
|
|
|
|
| 3 |
import pandas as pd
|
| 4 |
from sentence_transformers import SentenceTransformer
|
| 5 |
# Importa le funzioni dal tuo script
|
|
@@ -8,6 +9,13 @@ from scripts.scripts.sign2text_mapping import sign2text
|
|
| 8 |
|
| 9 |
# Configurazione iniziale del modello e dei dati
|
| 10 |
def load_resources():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
# Modello di embedding
|
| 12 |
model_name = "mixedbread-ai/mxbai-embed-large-v1"
|
| 13 |
model = SentenceTransformer(model_name)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import json
|
| 3 |
+
import zipfile
|
| 4 |
import pandas as pd
|
| 5 |
from sentence_transformers import SentenceTransformer
|
| 6 |
# Importa le funzioni dal tuo script
|
|
|
|
| 9 |
|
| 10 |
# Configurazione iniziale del modello e dei dati
|
| 11 |
def load_resources():
|
| 12 |
+
zip_file_path = 'tools/corpus_embeddings.json.zip'
|
| 13 |
+
output_folder = 'tools/'
|
| 14 |
+
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
|
| 15 |
+
zip_ref.extractall(output_folder)
|
| 16 |
+
|
| 17 |
+
print("File estratto con successo.")
|
| 18 |
+
|
| 19 |
# Modello di embedding
|
| 20 |
model_name = "mixedbread-ai/mxbai-embed-large-v1"
|
| 21 |
model = SentenceTransformer(model_name)
|