Commit
·
b29a13c
1
Parent(s):
8ccb395
create model structure
Browse files- README.md +2 -1
- config.json +22 -0
- main.py +8 -0
- poetry.lock +0 -0
- pyproject.toml +17 -0
README.md
CHANGED
@@ -1 +1,2 @@
|
|
1 |
-
#Testing local upload
|
|
|
|
1 |
+
#Testing local upload
|
2 |
+
|
config.json
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"activation": "relu",
|
3 |
+
"architectures": [
|
4 |
+
"DistilBertForMaskedLM"
|
5 |
+
],
|
6 |
+
"attention_dropout": 0.4,
|
7 |
+
"dim": 768,
|
8 |
+
"dropout": 0.1,
|
9 |
+
"hidden_dim": 3072,
|
10 |
+
"initializer_range": 0.02,
|
11 |
+
"max_position_embeddings": 512,
|
12 |
+
"model_type": "distilbert",
|
13 |
+
"n_heads": 12,
|
14 |
+
"n_layers": 6,
|
15 |
+
"pad_token_id": 0,
|
16 |
+
"qa_dropout": 0.1,
|
17 |
+
"seq_classif_dropout": 0.2,
|
18 |
+
"sinusoidal_pos_embds": false,
|
19 |
+
"tie_weights_": true,
|
20 |
+
"transformers_version": "4.47.1",
|
21 |
+
"vocab_size": 30522
|
22 |
+
}
|
main.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import DistilBertConfig, DistilBertForQuestionAnswering, DistilBertTokenizerFast, ViTImageProcessorFast, Wav2Vec2FeatureExtractor, Wav2Vec2Processor
|
2 |
+
|
3 |
+
config = DistilBertConfig.from_pretrained("./config.json")
|
4 |
+
model = DistilBertForQuestionAnswering.from_pretrained("distilbert/distilbert-base-uncased",config=config)
|
5 |
+
tokenizer = DistilBertTokenizerFast.from_pretrained("distilbert/distilbert-base-uncased")
|
6 |
+
vit_extractor = ViTImageProcessorFast.from_pretrained("google/vit-base-patch16-224")
|
7 |
+
feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained("facebook/wav2vec2-base-960h")
|
8 |
+
processor = Wav2Vec2Processor(feature_extractor=feature_extractor, tokenizer=tokenizer)
|
poetry.lock
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pyproject.toml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[tool.poetry]
|
2 |
+
name = "ghanabaai-model"
|
3 |
+
version = "0.1.0"
|
4 |
+
description = ""
|
5 |
+
authors = ["Faith S.Appoh <[email protected]>"]
|
6 |
+
readme = "README.md"
|
7 |
+
package-mode = false
|
8 |
+
|
9 |
+
[tool.poetry.dependencies]
|
10 |
+
python = "^3.12"
|
11 |
+
transformers = "^4.47.1"
|
12 |
+
torch = "^2.5.1"
|
13 |
+
|
14 |
+
|
15 |
+
[build-system]
|
16 |
+
requires = ["poetry-core"]
|
17 |
+
build-backend = "poetry.core.masonry.api"
|