Spaces:
Sleeping
Sleeping
Update tasks/text.py
Browse files- tasks/text.py +2 -2
tasks/text.py
CHANGED
@@ -16,7 +16,7 @@ DESCRIPTION = "GTE Architecture"
|
|
16 |
ROUTE = "/text"
|
17 |
|
18 |
class AutoBertClassifier(nn.Module):
|
19 |
-
def __init__(self, num_labels=8, model_path="
|
20 |
super().__init__()
|
21 |
self.tokenizer = AutoTokenizer.from_pretrained(model_path)
|
22 |
self.bert = AutoModel.from_pretrained(model_path)
|
@@ -34,7 +34,7 @@ class AutoBertClassifier(nn.Module):
|
|
34 |
|
35 |
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
36 |
|
37 |
-
model_repo = "elucidator8918/frugal-ai-text-final"
|
38 |
model = AutoBertClassifier(num_labels=8)
|
39 |
model.load_state_dict(load_file(hf_hub_download(repo_id=model_repo, filename="model.safetensors")))
|
40 |
tokenizer = AutoTokenizer.from_pretrained(model_repo)
|
|
|
16 |
ROUTE = "/text"
|
17 |
|
18 |
class AutoBertClassifier(nn.Module):
|
19 |
+
def __init__(self, num_labels=8, model_path="TaylorAI/gte-tiny"):
|
20 |
super().__init__()
|
21 |
self.tokenizer = AutoTokenizer.from_pretrained(model_path)
|
22 |
self.bert = AutoModel.from_pretrained(model_path)
|
|
|
34 |
|
35 |
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
36 |
|
37 |
+
model_repo = "elucidator8918/frugal-ai-text-tiny-final"
|
38 |
model = AutoBertClassifier(num_labels=8)
|
39 |
model.load_state_dict(load_file(hf_hub_download(repo_id=model_repo, filename="model.safetensors")))
|
40 |
tokenizer = AutoTokenizer.from_pretrained(model_repo)
|