Spaces:
Runtime error
Runtime error
ruanchaves
commited on
Commit
•
795534a
1
Parent(s):
8035793
feat: datasets and emojis
Browse files
README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
---
|
2 |
title: Portuguese Semantic Similarity
|
3 |
-
emoji:
|
4 |
colorFrom: blue
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
@@ -8,6 +8,7 @@ sdk_version: 3.23.0
|
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: mit
|
|
|
11 |
---
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
title: Portuguese Semantic Similarity
|
3 |
+
emoji: 🍂
|
4 |
colorFrom: blue
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
|
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: mit
|
11 |
+
datasets: ["assin", "assin2"]
|
12 |
---
|
13 |
|
14 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
@@ -85,7 +85,7 @@ def similarity(s1, s2):
|
|
85 |
name = user_friendly_name[row["name"]]
|
86 |
tokenizer = row["tokenizer"]
|
87 |
model = row["model"]
|
88 |
-
model_input = tokenizer(*([s1
|
89 |
with torch.no_grad():
|
90 |
output = model(**model_input)
|
91 |
score = output[0][0].item()
|
|
|
85 |
name = user_friendly_name[row["name"]]
|
86 |
tokenizer = row["tokenizer"]
|
87 |
model = row["model"]
|
88 |
+
model_input = tokenizer(*([s1], [s2]), padding=True, return_tensors="pt")
|
89 |
with torch.no_grad():
|
90 |
output = model(**model_input)
|
91 |
score = output[0][0].item()
|