hojzas commited on
Commit
1f244b9
1 Parent(s): 58c61eb

Add SetFit model

Browse files
Files changed (1) hide show
  1. README.md +31 -18
README.md CHANGED
@@ -10,26 +10,34 @@ datasets:
10
  metrics:
11
  - accuracy
12
  widget:
13
- - text: 'def first_with_given_key(iterable, key=lambda x: x):\n keys_used = {}\n for
14
- item in iterable:\n rp = repr(key(item))\n if rp not in keys_used.keys():\n keys_used[rp]
15
- = repr(item)\n yield item'
16
- - text: 'def first_with_given_key(iterable, key=lambda x: x):\n keys=[]\n for
17
- i in iterable:\n if key(i) not in keys:\n yield i\n keys.append(key(i))'
18
- - text: 'def first_with_given_key(iterable, key=repr):\n set_of_keys = set()\n lambda_key
19
- = (lambda x: key(x))\n for item in iterable:\n key = lambda_key(item)\n try:\n key_for_set
20
- = hash(key)\n except TypeError:\n key_for_set = repr(key)\n if
21
- key_for_set in set_of_keys:\n continue\n set_of_keys.add(key_for_set)\n yield
22
- item'
23
- - text: 'def first_with_given_key(iterable, key = lambda x: x):\n found_keys={}\n for
24
- i in iterable:\n if key(i) not in found_keys.keys():\n found_keys[key(i)]=i\n yield
25
- i'
26
- - text: 'def first_with_given_key(the_iterable, key=lambda x: x):\n temp_keys=[]\n for
27
- i in range(len(the_iterable)):\n if (key(the_iterable[i]) not in temp_keys):\n temp_keys.append(key(the_iterable[i]))\n yield
28
- the_iterable[i]\n del temp_keys'
 
 
 
 
 
 
 
 
29
  pipeline_tag: text-classification
30
  inference: true
31
  co2_eq_emissions:
32
- emissions: 0.2501735110964191
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):\n keys=[]\n for i in iterable:\n if key(i) not in keys:\n yield i\n keys.append(key(i))")
 
 
 
 
 
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
  <!--