Spaces:
Sleeping
Sleeping
Abdulvahap
commited on
Commit
•
3103fe2
1
Parent(s):
634df6a
Update app.py
Browse files
app.py
CHANGED
@@ -7,21 +7,9 @@ import gradio as gr
|
|
7 |
RETRY_ATTEMPTS = 10
|
8 |
TIMEOUT = 20 # Increase the timeout to 20 seconds
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
model =
|
13 |
-
|
14 |
-
sentences = [
|
15 |
-
"Bu çok mutlu bir kişi",
|
16 |
-
"Bu mutlu bir köpek",
|
17 |
-
"Bu sevincinden havalara uçan bir insan",
|
18 |
-
"Çok kar yağıyor"
|
19 |
-
]
|
20 |
-
embeddings = model.encode(sentences)
|
21 |
-
|
22 |
-
similarities = model.similarity(embeddings, embeddings)
|
23 |
-
print(similarities.shape)
|
24 |
-
# [4, 4]
|
25 |
|
26 |
def predict(input_text):
|
27 |
"""Generate a response based solely on the current input text."""
|
|
|
7 |
RETRY_ATTEMPTS = 10
|
8 |
TIMEOUT = 20 # Increase the timeout to 20 seconds
|
9 |
|
10 |
+
# Load model directly
|
11 |
+
from transformers import AutoModel
|
12 |
+
model = AutoModel.from_pretrained("dbmdz/bert-base-turkish-128k-uncased")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
def predict(input_text):
|
15 |
"""Generate a response based solely on the current input text."""
|