Sharathhebbar24
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ class SentenceSimiliarity():
|
|
8 |
self.sentence1 = sentence1
|
9 |
self.sentence2 = sentence2
|
10 |
self.model_name = model_name
|
11 |
-
self.model =
|
12 |
self.tokenizer = AutoTokenizer.from_pretrained(self.model_name)
|
13 |
|
14 |
def tokenize(self):
|
@@ -76,15 +76,17 @@ class UI():
|
|
76 |
"togethercomputer/m2-bert-80M-8k-retrieval",
|
77 |
"togethercomputer/m2-bert-80M-2k-retrieval",
|
78 |
]
|
79 |
-
|
80 |
label="Select Your Models",
|
81 |
options=available_models,
|
82 |
)
|
83 |
-
|
|
|
84 |
|
85 |
def result(self):
|
86 |
self.get()
|
87 |
-
|
|
|
88 |
|
89 |
if self.button:
|
90 |
st.text(ss.results())
|
|
|
8 |
self.sentence1 = sentence1
|
9 |
self.sentence2 = sentence2
|
10 |
self.model_name = model_name
|
11 |
+
self.model = AutoModel.from_pretrained(self.model_name)
|
12 |
self.tokenizer = AutoTokenizer.from_pretrained(self.model_name)
|
13 |
|
14 |
def tokenize(self):
|
|
|
76 |
"togethercomputer/m2-bert-80M-8k-retrieval",
|
77 |
"togethercomputer/m2-bert-80M-2k-retrieval",
|
78 |
]
|
79 |
+
model_name = st.sidebar.selectbox(
|
80 |
label="Select Your Models",
|
81 |
options=available_models,
|
82 |
)
|
83 |
+
return model_name
|
84 |
+
|
85 |
|
86 |
def result(self):
|
87 |
self.get()
|
88 |
+
model_name = self.model_selection()
|
89 |
+
ss = SentenceSimiliarity(model_name, self.sentence1, self.sentence2)
|
90 |
|
91 |
if self.button:
|
92 |
st.text(ss.results())
|