nguyen1207
commited on
Commit
•
3ad6269
1
Parent(s):
6beea90
update title, fix logic
Browse files
app.py
CHANGED
@@ -6,18 +6,17 @@ from transformers import AutoModel, AutoTokenizer
|
|
6 |
model_name = 'intfloat/multilingual-e5-large'
|
7 |
adapters_name = './checkpoint-21170'
|
8 |
|
9 |
-
|
10 |
-
model = AutoModel.from_pretrained(model_name)
|
11 |
-
model = PeftModel.from_pretrained(model, adapters_name)
|
12 |
-
model = model.merge_and_unload()
|
13 |
-
|
14 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
15 |
-
|
16 |
-
st.header("Irrelevant Review Detections :sunglasses:")
|
17 |
description = st.text_input("Product description")
|
18 |
review = st.text_input("Review")
|
19 |
|
20 |
if st.button("Detect") and description and review:
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
input_texts = [
|
22 |
f'query: {review}',
|
23 |
f'passage: {description}'
|
|
|
6 |
model_name = 'intfloat/multilingual-e5-large'
|
7 |
adapters_name = './checkpoint-21170'
|
8 |
|
9 |
+
st.header(":shopping_trolley: Irrelevant Reviews Detection :sunglasses:")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
description = st.text_input("Product description")
|
11 |
review = st.text_input("Review")
|
12 |
|
13 |
if st.button("Detect") and description and review:
|
14 |
+
model = AutoModel.from_pretrained(model_name)
|
15 |
+
model = PeftModel.from_pretrained(model, adapters_name)
|
16 |
+
model = model.merge_and_unload()
|
17 |
+
|
18 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
19 |
+
|
20 |
input_texts = [
|
21 |
f'query: {review}',
|
22 |
f'passage: {description}'
|