|
31 | 31 | "pytorch": "hf-internal-testing/tiny-random-bert",
|
32 | 32 | "tensorflow": "hf-internal-testing/tiny-random-bert",
|
33 | 33 | },
|
34 |
| - "ner": { |
| 34 | + "token-classification": { |
35 | 35 | "pytorch": "hf-internal-testing/tiny-random-roberta",
|
36 | 36 | "tensorflow": "hf-internal-testing/tiny-random-roberta",
|
37 | 37 | },
|
|
80 | 80 | "tensorflow": "hf-internal-testing/tiny-random-clip-zero-shot-image-classification",
|
81 | 81 | },
|
82 | 82 | "conversational": {
|
83 |
| - #"pytorch": "hf-internal-testing/tiny-random-blenderbot-small", |
| 83 | + # "pytorch": "hf-internal-testing/tiny-random-blenderbot-small", |
84 | 84 | "pytorch": "microsoft/DialoGPT-small",
|
85 | 85 | "tensorflow": None,
|
86 | 86 | },
|
|
118 | 118 | "parameters": {"candidate_labels": ["refund", "legal", "faq"]},
|
119 | 119 | },
|
120 | 120 | "feature-extraction": {"inputs": "What is the best book."},
|
121 |
| - "ner": {"inputs": "My name is Wolfgang and I live in Berlin"}, |
| 121 | + "token-classification": {"inputs": "My name is Wolfgang and I live in Berlin"}, |
122 | 122 | "question-answering": {
|
123 | 123 | "inputs": {
|
124 | 124 | "question": "What is used for inference?",
|
|
134 | 134 | "inputs": "question: What is 42 context: 42 is the answer to life, the universe and everything."
|
135 | 135 | },
|
136 | 136 | "text-generation": {"inputs": "My name is philipp and I am"},
|
137 |
| - "image-classification": open(os.path.join(os.getcwd(), "tests/resources/image/tiger.jpeg"), "rb").read(), |
138 |
| - "zero-shot-image-classification": open(os.path.join(os.getcwd(), "tests/resources/image/tiger.jpeg"), "rb").read(), |
139 |
| - "object-detection": open(os.path.join(os.getcwd(), "tests/resources/image/tiger.jpeg"), "rb").read(), |
140 |
| - "image-segmentation": open(os.path.join(os.getcwd(), "tests/resources/image/tiger.jpeg"), "rb").read(), |
141 |
| - "automatic-speech-recognition": open(os.path.join(os.getcwd(), "tests/resources/audio/sample1.flac"), "rb").read(), |
142 |
| - "audio-classification": open(os.path.join(os.getcwd(), "tests/resources/audio/sample1.flac"), "rb").read(), |
| 137 | + "image-classification": open( |
| 138 | + os.path.join(os.getcwd(), "tests/resources/image/tiger.jpeg"), "rb" |
| 139 | + ).read(), |
| 140 | + "zero-shot-image-classification": open( |
| 141 | + os.path.join(os.getcwd(), "tests/resources/image/tiger.jpeg"), "rb" |
| 142 | + ).read(), |
| 143 | + "object-detection": open( |
| 144 | + os.path.join(os.getcwd(), "tests/resources/image/tiger.jpeg"), "rb" |
| 145 | + ).read(), |
| 146 | + "image-segmentation": open( |
| 147 | + os.path.join(os.getcwd(), "tests/resources/image/tiger.jpeg"), "rb" |
| 148 | + ).read(), |
| 149 | + "automatic-speech-recognition": open( |
| 150 | + os.path.join(os.getcwd(), "tests/resources/audio/sample1.flac"), "rb" |
| 151 | + ).read(), |
| 152 | + "audio-classification": open( |
| 153 | + os.path.join(os.getcwd(), "tests/resources/audio/sample1.flac"), "rb" |
| 154 | + ).read(), |
143 | 155 | "table-question-answering": {
|
144 | 156 | "inputs": {
|
145 | 157 | "query": "How many stars does the transformers repository have?",
|
|
151 | 163 | },
|
152 | 164 | }
|
153 | 165 | },
|
154 |
| - "conversational": {"inputs": [ |
155 |
| - { |
156 |
| - "role": "user", |
157 |
| - "content": "Which movie is the best ?" |
158 |
| - }, |
159 |
| - { |
160 |
| - "role": "assistant", |
161 |
| - "content": "It's Die Hard for sure." |
162 |
| - }, |
163 |
| - { |
164 |
| - "role": "user", |
165 |
| - "content": "Can you explain why?" |
166 |
| - } |
167 |
| - ]}, |
| 166 | + "conversational": { |
| 167 | + "inputs": [ |
| 168 | + {"role": "user", "content": "Which movie is the best ?"}, |
| 169 | + {"role": "assistant", "content": "It's Die Hard for sure."}, |
| 170 | + {"role": "user", "content": "Can you explain why?"}, |
| 171 | + ] |
| 172 | + }, |
168 | 173 | "sentence-similarity": {
|
169 |
| - "inputs": {"source_sentence": "Lets create an embedding", "sentences": ["Lets create an embedding"]} |
| 174 | + "inputs": { |
| 175 | + "source_sentence": "Lets create an embedding", |
| 176 | + "sentences": ["Lets create an embedding"], |
| 177 | + } |
170 | 178 | },
|
171 | 179 | "sentence-embeddings": {"inputs": "Lets create an embedding"},
|
172 |
| - "sentence-ranking": {"inputs": ["Lets create an embedding", "Lets create an embedding"]}, |
| 180 | + "sentence-ranking": { |
| 181 | + "inputs": ["Lets create an embedding", "Lets create an embedding"] |
| 182 | + }, |
173 | 183 | "text-to-image": {"inputs": "a man on a horse jumps over a broken down airplane."},
|
174 |
| - "custom": {"inputs": "this is a test"} |
| 184 | + "custom": {"inputs": "this is a test"}, |
175 | 185 | }
|
176 | 186 |
|
177 | 187 | task2output = {
|
|
181 | 191 | "labels": ["refund", "faq", "legal"],
|
182 | 192 | "scores": [0.96, 0.027, 0.008],
|
183 | 193 | },
|
184 |
| - "ner": [ |
185 |
| - {"word": "Wolfgang", "score": 0.99, "entity": "I-PER", "index": 4, "start": 11, "end": 19}, |
186 |
| - {"word": "Berlin", "score": 0.99, "entity": "I-LOC", "index": 9, "start": 34, "end": 40}, |
| 194 | + "token-classification": [ |
| 195 | + { |
| 196 | + "word": "Wolfgang", |
| 197 | + "score": 0.99, |
| 198 | + "entity": "I-PER", |
| 199 | + "index": 4, |
| 200 | + "start": 11, |
| 201 | + "end": 19, |
| 202 | + }, |
| 203 | + { |
| 204 | + "word": "Berlin", |
| 205 | + "score": 0.99, |
| 206 | + "entity": "I-LOC", |
| 207 | + "index": 9, |
| 208 | + "start": 34, |
| 209 | + "end": 40, |
| 210 | + }, |
| 211 | + ], |
| 212 | + "question-answering": { |
| 213 | + "score": 0.99, |
| 214 | + "start": 68, |
| 215 | + "end": 77, |
| 216 | + "answer": "sagemaker", |
| 217 | + }, |
| 218 | + "summarization": [ |
| 219 | + {"summary_text": " The A The The ANew York City has been installed in the US."} |
| 220 | + ], |
| 221 | + "translation_xx_to_yy": [ |
| 222 | + {"translation_text": "Mein Name ist Sarah und ich lebe in London"} |
| 223 | + ], |
| 224 | + "text2text-generation": [ |
| 225 | + {"generated_text": "42 is the answer to life, the universe and everything"} |
187 | 226 | ],
|
188 |
| - "question-answering": {"score": 0.99, "start": 68, "end": 77, "answer": "sagemaker"}, |
189 |
| - "summarization": [{"summary_text": " The A The The ANew York City has been installed in the US."}], |
190 |
| - "translation_xx_to_yy": [{"translation_text": "Mein Name ist Sarah und ich lebe in London"}], |
191 |
| - "text2text-generation": [{"generated_text": "42 is the answer to life, the universe and everything"}], |
192 | 227 | "feature-extraction": None,
|
193 | 228 | "fill-mask": None,
|
194 | 229 | "text-generation": None,
|
195 | 230 | "image-classification": [
|
196 | 231 | {"score": 0.8858247399330139, "label": "tiger, Panthera tigris"},
|
197 | 232 | {"score": 0.10940514504909515, "label": "tiger cat"},
|
198 |
| - {"score": 0.0006216464680619538, "label": "jaguar, panther, Panthera onca, Felis onca"}, |
| 233 | + { |
| 234 | + "score": 0.0006216464680619538, |
| 235 | + "label": "jaguar, panther, Panthera onca, Felis onca", |
| 236 | + }, |
199 | 237 | {"score": 0.0004262699221726507, "label": "dhole, Cuon alpinus"},
|
200 |
| - {"score": 0.00030842673731967807, "label": "lion, king of beasts, Panthera leo"}, |
| 238 | + { |
| 239 | + "score": 0.00030842673731967807, |
| 240 | + "label": "lion, king of beasts, Panthera leo", |
| 241 | + }, |
201 | 242 | ],
|
202 | 243 | "zero-shot-image-classification": [
|
203 | 244 | {"score": 0.8858247399330139, "label": "tiger, Panthera tigris"},
|
204 | 245 | {"score": 0.10940514504909515, "label": "tiger cat"},
|
205 |
| - {"score": 0.0006216464680619538, "label": "jaguar, panther, Panthera onca, Felis onca"}, |
| 246 | + { |
| 247 | + "score": 0.0006216464680619538, |
| 248 | + "label": "jaguar, panther, Panthera onca, Felis onca", |
| 249 | + }, |
206 | 250 | {"score": 0.0004262699221726507, "label": "dhole, Cuon alpinus"},
|
207 |
| - {"score": 0.00030842673731967807, "label": "lion, king of beasts, Panthera leo"}, |
| 251 | + { |
| 252 | + "score": 0.00030842673731967807, |
| 253 | + "label": "lion, king of beasts, Panthera leo", |
| 254 | + }, |
208 | 255 | ],
|
209 | 256 | "automatic-speech-recognition": {
|
210 | 257 | "text": "GOING ALONG SLUSHY COUNTRY ROADS AND SPEAKING TO DAMP OAUDIENCES IN DROFTY SCHOOL ROOMS DAY AFTER DAY FOR A FORT NIGHT HE'LL HAVE TO PUT IN AN APPEARANCE AT SOME PLACE OF WORSHIP ON SUNDAY MORNING AND HE CAN COME TO US IMMEDIATELY AFTERWARDS"
|
|
217 | 264 | "image-segmentation": [{"score": 0.9143241047859192, "label": "cat", "mask": {}}],
|
218 | 265 | "table-question-answering": {"answer": "36542"},
|
219 | 266 | "conversational": [
|
220 |
| - {'role': 'user', 'content': 'Which movie is the best ?'}, |
221 |
| - {'role': 'assistant', 'content': "It's Die Hard for sure."}, |
222 |
| - {'role': 'user', 'content': 'Can you explain why?'}, |
223 |
| - {'role': 'assistant', 'content': "It's a great movie."}, |
| 267 | + {"role": "user", "content": "Which movie is the best ?"}, |
| 268 | + {"role": "assistant", "content": "It's Die Hard for sure."}, |
| 269 | + {"role": "user", "content": "Can you explain why?"}, |
| 270 | + {"role": "assistant", "content": "It's a great movie."}, |
224 | 271 | ],
|
225 | 272 | "sentence-similarity": {"similarities": ""},
|
226 | 273 | "sentence-embeddings": {"embeddings": ""},
|
227 | 274 | "sentence-ranking": {"scores": ""},
|
228 | 275 | "text-to-image": bytes,
|
229 |
| - "custom": {"inputs": "this is a test"} |
| 276 | + "custom": {"inputs": "this is a test"}, |
230 | 277 | }
|
231 | 278 |
|
232 | 279 |
|
|
235 | 282 | "zero-shot-classification": validate_zero_shot_classification,
|
236 | 283 | "zero-shot-image-classification": validate_zero_shot_classification,
|
237 | 284 | "feature-extraction": validate_feature_extraction,
|
238 |
| - "ner": validate_ner, |
| 285 | + "token-classification": validate_ner, |
239 | 286 | "question-answering": validate_question_answering,
|
240 | 287 | "fill-mask": validate_fill_mask,
|
241 | 288 | "summarization": validate_summarization,
|
|
253 | 300 | "sentence-embeddings": validate_zero_shot_classification,
|
254 | 301 | "sentence-ranking": validate_zero_shot_classification,
|
255 | 302 | "text-to-image": validate_text_to_image,
|
256 |
| - "custom": validate_custom |
| 303 | + "custom": validate_custom, |
257 | 304 | }
|
0 commit comments