Commit From AutoNLP
Browse files- .gitattributes +2 -0
- README.md +60 -0
- config.json +31 -0
- pytorch_model.bin +3 -0
- sample_input.pkl +3 -0
- sentencepiece.bpe.model +3 -0
- special_tokens_map.json +1 -0
- tokenizer.json +0 -0
- tokenizer_config.json +1 -0
.gitattributes
CHANGED
@@ -25,3 +25,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- autonlp
|
4 |
+
- question-answering
|
5 |
+
language: unk
|
6 |
+
widget:
|
7 |
+
- text: "Who loves AutoNLP?"
|
8 |
+
context: "Everyone loves AutoNLP"
|
9 |
+
datasets:
|
10 |
+
- teacookies/autonlp-data-more_fine_tune_24465520
|
11 |
+
co2_eq_emissions: 103.5636883689371
|
12 |
+
---
|
13 |
+
|
14 |
+
# Model Trained Using AutoNLP
|
15 |
+
|
16 |
+
- Problem type: Extractive Question Answering
|
17 |
+
- Model ID: 26265907
|
18 |
+
- CO2 Emissions (in grams): 103.5636883689371
|
19 |
+
|
20 |
+
## Validation Metrics
|
21 |
+
|
22 |
+
- Loss: 0.6072460412979126
|
23 |
+
|
24 |
+
## Usage
|
25 |
+
|
26 |
+
You can use cURL to access this model:
|
27 |
+
|
28 |
+
```
|
29 |
+
$ curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"question": "Who loves AutoNLP?", "context": "Everyone loves AutoNLP"}' https://api-inference.huggingface.co/models/teacookies/autonlp-more_fine_tune_24465520-26265907
|
30 |
+
```
|
31 |
+
|
32 |
+
Or Python API:
|
33 |
+
|
34 |
+
```
|
35 |
+
import torch
|
36 |
+
|
37 |
+
from transformers import AutoModelForQuestionAnswering, AutoTokenizer
|
38 |
+
|
39 |
+
model = AutoModelForQuestionAnswering.from_pretrained("teacookies/autonlp-more_fine_tune_24465520-26265907", use_auth_token=True)
|
40 |
+
|
41 |
+
tokenizer = AutoTokenizer.from_pretrained("teacookies/autonlp-more_fine_tune_24465520-26265907", use_auth_token=True)
|
42 |
+
|
43 |
+
from transformers import BertTokenizer, BertForQuestionAnswering
|
44 |
+
|
45 |
+
question, text = "Who loves AutoNLP?", "Everyone loves AutoNLP"
|
46 |
+
|
47 |
+
inputs = tokenizer(question, text, return_tensors='pt')
|
48 |
+
|
49 |
+
start_positions = torch.tensor([1])
|
50 |
+
|
51 |
+
end_positions = torch.tensor([3])
|
52 |
+
|
53 |
+
outputs = model(**inputs, start_positions=start_positions, end_positions=end_positions)
|
54 |
+
|
55 |
+
loss = outputs.loss
|
56 |
+
|
57 |
+
start_scores = outputs.start_logits
|
58 |
+
|
59 |
+
end_scores = outputs.end_logits
|
60 |
+
```
|
config.json
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "AutoNLP",
|
3 |
+
"architectures": [
|
4 |
+
"XLMRobertaForQuestionAnswering"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"bos_token_id": 0,
|
8 |
+
"eos_token_id": 2,
|
9 |
+
"gradient_checkpointing": false,
|
10 |
+
"hidden_act": "gelu",
|
11 |
+
"hidden_dropout_prob": 0.1,
|
12 |
+
"hidden_size": 768,
|
13 |
+
"initializer_range": 0.02,
|
14 |
+
"intermediate_size": 3072,
|
15 |
+
"language": "english",
|
16 |
+
"layer_norm_eps": 1e-05,
|
17 |
+
"max_length": 512,
|
18 |
+
"max_position_embeddings": 514,
|
19 |
+
"model_type": "xlm-roberta",
|
20 |
+
"name": "XLMRoberta",
|
21 |
+
"num_attention_heads": 12,
|
22 |
+
"num_hidden_layers": 12,
|
23 |
+
"output_past": true,
|
24 |
+
"pad_token_id": 1,
|
25 |
+
"padding": "max_length",
|
26 |
+
"position_embedding_type": "absolute",
|
27 |
+
"transformers_version": "4.8.0",
|
28 |
+
"type_vocab_size": 1,
|
29 |
+
"use_cache": true,
|
30 |
+
"vocab_size": 250002
|
31 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7501b049cf4150f260bfd7eaada48f2154e1c7629d7ccb05b28de7685a08ea65
|
3 |
+
size 1109903089
|
sample_input.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f73a8d7b465d26c030c111f1c2f15636a6128b293c21e591bfe7e73040e64af4
|
3 |
+
size 2724
|
sentencepiece.bpe.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
|
3 |
+
size 5069051
|
special_tokens_map.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "sep_token": "</s>", "pad_token": "<pad>", "cls_token": "<s>", "mask_token": "<mask>"}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"bos_token": "<s>", "eos_token": "</s>", "sep_token": "</s>", "cls_token": "<s>", "unk_token": "<unk>", "pad_token": "<pad>", "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "do_lower_case": false, "model_max_length": 512, "full_tokenizer_file": null, "special_tokens_map_file": "/root/.cache/huggingface/transformers/b285d730ad6193f7e96b41152fbc5fb05620f0961f6f513e2d36868dfb1eb2a7.0dc5b1041f62041ebbd23b1297f2f573769d5c97d8b7c28180ec86b8f6185aa8", "name_or_path": "AutoNLP", "sp_model_kwargs": {}, "tokenizer_class": "XLMRobertaTokenizer"}
|