Commit History

Update routes/predict_batch.py
db12eca
verified

AhmedRabie01 commited on

Rename Sentiment/ml/model/multitask_bert.pyimport torch import torch.nn as nn from transformers import AutoConfig, AutoModel class MultiTaskBert(nn.Module): def __init__( self, model_name: str, n_sentiment: int, n_intent: int, n_topic: int, dropout: float = 0.2, init_from_pretrained: bool = False, # IMPORTANT ): super().__init__() self.model_name = model_name if init_from_pretrained: # trust_remote_code lets us load architectures (e.g., ModernBERT/mmBERT) # that may not be bundled with the installed transformers version. self.encoder = AutoModel.from_pretrained( model_name, trust_remote_code=True, ) else: config = AutoConfig.from_pretrained( model_name, trust_remote_code=True, ) self.encoder = AutoModel.from_config( config, trust_remote_code=True, ) hidden_size = self.encoder.config.hidden_size self.dropout = nn.Dropout(dropout) self.sentiment_head = nn.Linear(hidden_size, n_sentiment) self.intent_head = nn.Linear(hidden_size, n_intent) self.topic_head = nn.Linear(hidden_size, n_topic) def forward(self, input_ids, attention_mask): outputs = self.encoder( input_ids=input_ids, attention_mask=attention_mask, ) pooled = outputs.last_hidden_state[:, 0] # CLS pooled = self.dropout(pooled) return ( self.sentiment_head(pooled), self.intent_head(pooled), self.topic_head(pooled), ) to Sentiment/ml/model/multitask_bert.py
da59a51
verified

AhmedRabie01 commited on

Create multitask_bert.pyimport torch import torch.nn as nn from transformers import AutoConfig, AutoModel class MultiTaskBert(nn.Module): def __init__( self, model_name: str, n_sentiment: int, n_intent: int, n_topic: int, dropout: float = 0.2, init_from_pretrained: bool = False, # IMPORTANT ): super().__init__() self.model_name = model_name if init_from_pretrained: # trust_remote_code lets us load architectures (e.g., ModernBERT/mmBERT) # that may not be bundled with the installed transformers version. self.encoder = AutoModel.from_pretrained( model_name, trust_remote_code=True, ) else: config = AutoConfig.from_pretrained( model_name, trust_remote_code=True, ) self.encoder = AutoModel.from_config( config, trust_remote_code=True, ) hidden_size = self.encoder.config.hidden_size self.dropout = nn.Dropout(dropout) self.sentiment_head = nn.Linear(hidden_size, n_sentiment) self.intent_head = nn.Linear(hidden_size, n_intent) self.topic_head = nn.Linear(hidden_size, n_topic) def forward(self, input_ids, attention_mask): outputs = self.encoder( input_ids=input_ids, attention_mask=attention_mask, ) pooled = outputs.last_hidden_state[:, 0] # CLS pooled = self.dropout(pooled) return ( self.sentiment_head(pooled), self.intent_head(pooled), self.topic_head(pooled), )
0991cf9
verified

AhmedRabie01 commited on

Create loader.py
2ef0ae4
verified

AhmedRabie01 commited on

Rename Sentiment/ml/model/file.txt to Sentiment/ml/model/__init__.py
ee67128
verified

AhmedRabie01 commited on

Delete Sentiment/ml/model
060a83c
verified

AhmedRabie01 commited on

Create Sentiment/ml/model/file.txt
f919db0
verified

AhmedRabie01 commited on

Update routes/predict_batch.py
e09b8b3
verified

AhmedRabie01 commited on

Update routes/predict_batch.py
0797838
verified

AhmedRabie01 commited on

Update Dockerfile
5fa3f76
verified

AhmedRabie01 commited on

Delete __init__.py
73f5419
verified

AhmedRabie01 commited on

Create __init__.py
67f347b
verified

AhmedRabie01 commited on

Update Dockerfile
c40dd27
verified

AhmedRabie01 commited on

Update Dockerfile
2a06b5b
verified

AhmedRabie01 commited on

Update Dockerfile
ba634f7
verified

AhmedRabie01 commited on

Update Dockerfile
229164f
verified

AhmedRabie01 commited on

Create __init__.py
14d6336
verified

AhmedRabie01 commited on

Create __init__.py
2144b69
verified

AhmedRabie01 commited on

Update requirements.txt
c25de50
verified

AhmedRabie01 commited on

Update Dockerfile
49ddb8f
verified

AhmedRabie01 commited on

Update requirements.txt
78f683e
verified

AhmedRabie01 commited on

Update requirements.txt
0f7cfaf
verified

AhmedRabie01 commited on

Create __init__.py
8593d57
verified

AhmedRabie01 commited on

Update routes/predict_batch.py
3e3ec1f
verified

AhmedRabie01 commited on

Update main.py
eacb077
verified

AhmedRabie01 commited on

Rename app.py to main.py
5b733aa
verified

AhmedRabie01 commited on

Update requirements.txt
51435f4
verified

AhmedRabie01 commited on

Update requirements.txt
a7a319e
verified

AhmedRabie01 commited on

Update Sentiment/ml/model /loader.py
733dc27
verified

AhmedRabie01 commited on

Create multitask_bert.py
5c6d699
verified

AhmedRabie01 commited on

Create Sentiment/ml/model /loader.py
df0afc3
verified

AhmedRabie01 commited on

Update requirements.txt
ed6b500
verified

AhmedRabie01 commited on

Delete saved_models
a2b3174
verified

AhmedRabie01 commited on

Delete saved_models/tokenizer/file.txt
0c819e9
verified

AhmedRabie01 commited on

Upload 3 files
5bd02a7
verified

AhmedRabie01 commited on

Create tokenizer/file.txt
7784197
verified

AhmedRabie01 commited on

Delete saved_models/tokenizer
7c38251
verified

AhmedRabie01 commited on

Create tokenizer/
897a24a
verified

AhmedRabie01 commited on

Create saved_models/meta.ymal
4740c69
verified

AhmedRabie01 commited on

Create Dockerfile
2520e52
verified

AhmedRabie01 commited on

Create requirements.txt
81a6c9e
verified

AhmedRabie01 commited on

Create dashboard.html
1de72f0
verified

AhmedRabie01 commited on

Create templates/index.html
eff23f4
verified

AhmedRabie01 commited on

Create schemas.py
1a7b3c5
verified

AhmedRabie01 commited on

Create predict_single.py
66a66cf
verified

AhmedRabie01 commited on

Delete routes
72551a5
verified

AhmedRabie01 commited on

Create routes/predict_single.py
afdfb4a
verified

AhmedRabie01 commited on

Create routes/predict_batch.py
b62f86e
verified

AhmedRabie01 commited on

initial commit
ba6281d
verified

AhmedRabie01 commited on