Add SetFit model
Browse files
README.md
CHANGED
@@ -10,26 +10,34 @@ datasets:
|
|
10 |
metrics:
|
11 |
- accuracy
|
12 |
widget:
|
13 |
-
- text:
|
14 |
-
|
15 |
-
|
16 |
-
-
|
17 |
-
|
18 |
-
- text:
|
19 |
-
=
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
- text:
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
pipeline_tag: text-classification
|
30 |
inference: true
|
31 |
co2_eq_emissions:
|
32 |
-
emissions: 0.
|
33 |
source: codecarbon
|
34 |
training_type: fine-tuning
|
35 |
on_cloud: false
|
@@ -90,7 +98,12 @@ from setfit import SetFitModel
|
|
90 |
# Download from the 🤗 Hub
|
91 |
model = SetFitModel.from_pretrained("hojzas/setfit-proj8-all-mpnet-base-v2")
|
92 |
# Run inference
|
93 |
-
preds = model("def first_with_given_key(iterable, key=lambda x: x)
|
|
|
|
|
|
|
|
|
|
|
94 |
```
|
95 |
|
96 |
<!--
|
|
|
10 |
metrics:
|
11 |
- accuracy
|
12 |
widget:
|
13 |
+
- text: "def first_with_given_key(iterable, key=lambda y: y):\n done=list()\n \
|
14 |
+
\ it=iter(iterable)\n while not False:\n try:\n value=next(it)\n\
|
15 |
+
\ if key(value) not in done:\n yield value\n \
|
16 |
+
\ done.insert(-1,key(value))\n except StopIteration:\n \
|
17 |
+
\ break"
|
18 |
+
- text: "def first_with_given_key(iterable, key=lambda y: y):\n it=iter(iterable)\n\
|
19 |
+
\ li=list()\n while not False:\n try:\n hodnota=next(it)\n\
|
20 |
+
\ if key(hodnota) not in li:\n yield hodnota\n \
|
21 |
+
\ li.insert(-1,key(hodnota))\n except StopIteration:\n \
|
22 |
+
\ break"
|
23 |
+
- text: "def first_with_given_key(iterable, key=lambda item : item):\n key_list\
|
24 |
+
\ = set()\n it = iter(iterable)\n while True:\n try:\n \
|
25 |
+
\ item = next(it)\n value = key(item)\n try:\n \
|
26 |
+
\ value = hash(value)\n except TypeError:\n value\
|
27 |
+
\ = repr(value)\n if value not in key_list:\n key_list.add(value)\n\
|
28 |
+
\ yield item\n except StopIteration:\n break"
|
29 |
+
- text: "def first_with_given_key(iterable, key=lambda x: x):\n done=list()\n \
|
30 |
+
\ for value in iterable:\n if key(value) not in done:\n yield\
|
31 |
+
\ value\n done.insert(-1,key(value))"
|
32 |
+
- text: "def first_with_given_key(iterable, key=repr):\n used_keys = {}\n get_key\
|
33 |
+
\ = return_key(key)\n for item in iterable:\n item_key = get_key(item)\n\
|
34 |
+
\ if item_key in used_keys.keys():\n continue\n try:\n\
|
35 |
+
\ used_keys[hash(item_key)] = repr(item)\n except TypeError:\n\
|
36 |
+
\ used_keys[repr(item_key)] = repr(item)\n yield item"
|
37 |
pipeline_tag: text-classification
|
38 |
inference: true
|
39 |
co2_eq_emissions:
|
40 |
+
emissions: 0.2503482872622149
|
41 |
source: codecarbon
|
42 |
training_type: fine-tuning
|
43 |
on_cloud: false
|
|
|
98 |
# Download from the 🤗 Hub
|
99 |
model = SetFitModel.from_pretrained("hojzas/setfit-proj8-all-mpnet-base-v2")
|
100 |
# Run inference
|
101 |
+
preds = model("def first_with_given_key(iterable, key=lambda x: x):
|
102 |
+
done=list()
|
103 |
+
for value in iterable:
|
104 |
+
if key(value) not in done:
|
105 |
+
yield value
|
106 |
+
done.insert(-1,key(value))")
|
107 |
```
|
108 |
|
109 |
<!--
|