Spaces:
Build error
Build error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
# let's import the libraries we need
|
| 2 |
-
from sentence_transformers import
|
|
|
|
| 3 |
import spacy
|
| 4 |
from sklearn.metrics.pairwise import cosine_similarity
|
| 5 |
from datasets import load_dataset
|
|
@@ -10,7 +11,6 @@ import sys
|
|
| 10 |
import pandas as pd
|
| 11 |
import numpy as np
|
| 12 |
import streamlit as st
|
| 13 |
-
import sentence_transformers
|
| 14 |
import torch
|
| 15 |
from tqdm import tqdm
|
| 16 |
tqdm.pandas()
|
|
@@ -89,7 +89,7 @@ with mod_container:
|
|
| 89 |
# let's pass the input to the loaded_model with torch compiled with cuda
|
| 90 |
if prompt:
|
| 91 |
# let's get the result
|
| 92 |
-
simscore =
|
| 93 |
|
| 94 |
from sentence_transformers import CrossEncoder
|
| 95 |
loaded_model = CrossEncoder("cross-encoder/stsb-roberta-base")
|
|
|
|
| 1 |
# let's import the libraries we need
|
| 2 |
+
#from sentence_transformers import SentenceTransformer
|
| 3 |
+
#from sentence_transformers import CrossEncoder
|
| 4 |
import spacy
|
| 5 |
from sklearn.metrics.pairwise import cosine_similarity
|
| 6 |
from datasets import load_dataset
|
|
|
|
| 11 |
import pandas as pd
|
| 12 |
import numpy as np
|
| 13 |
import streamlit as st
|
|
|
|
| 14 |
import torch
|
| 15 |
from tqdm import tqdm
|
| 16 |
tqdm.pandas()
|
|
|
|
| 89 |
# let's pass the input to the loaded_model with torch compiled with cuda
|
| 90 |
if prompt:
|
| 91 |
# let's get the result
|
| 92 |
+
simscore = loaded_model.predict([prompt])
|
| 93 |
|
| 94 |
from sentence_transformers import CrossEncoder
|
| 95 |
loaded_model = CrossEncoder("cross-encoder/stsb-roberta-base")
|