Update README.md
Browse files
README.md
CHANGED
|
@@ -45,7 +45,7 @@ model.eval()
|
|
| 45 |
import torch
|
| 46 |
import torch.nn as nn
|
| 47 |
import torch.nn.functional as F
|
| 48 |
-
from transformers import
|
| 49 |
from huggingface_hub import hf_hub_download
|
| 50 |
|
| 51 |
class TemporalFusionClassifier(nn.Module):
|
|
@@ -89,7 +89,7 @@ class AICodeDetector:
|
|
| 89 |
self.cb_tokenizer = AutoTokenizer.from_pretrained("microsoft/codebert-base-mlm")
|
| 90 |
self.cb_model = AutoModelForMaskedLM.from_pretrained("microsoft/codebert-base-mlm").to(self.device).eval()
|
| 91 |
|
| 92 |
-
self.t5_tokenizer =
|
| 93 |
base_t5 = T5EncoderModel.from_pretrained("Salesforce/codet5-base")
|
| 94 |
|
| 95 |
weights_path = hf_hub_download(repo_id=repo_id, filename="pytorch_model.bin")
|
|
@@ -172,5 +172,5 @@ int main() {
|
|
| 172 |
|
| 173 |
if __name__ == "__main__":
|
| 174 |
detector = AICodeDetector()
|
| 175 |
-
print(detector.analyze(sample))
|
| 176 |
```
|
|
|
|
| 45 |
import torch
|
| 46 |
import torch.nn as nn
|
| 47 |
import torch.nn.functional as F
|
| 48 |
+
from transformers import T5EncoderModel, AutoTokenizer, AutoModelForMaskedLM
|
| 49 |
from huggingface_hub import hf_hub_download
|
| 50 |
|
| 51 |
class TemporalFusionClassifier(nn.Module):
|
|
|
|
| 89 |
self.cb_tokenizer = AutoTokenizer.from_pretrained("microsoft/codebert-base-mlm")
|
| 90 |
self.cb_model = AutoModelForMaskedLM.from_pretrained("microsoft/codebert-base-mlm").to(self.device).eval()
|
| 91 |
|
| 92 |
+
self.t5_tokenizer = AutoTokenizer.from_pretrained("Salesforce/codet5-base")
|
| 93 |
base_t5 = T5EncoderModel.from_pretrained("Salesforce/codet5-base")
|
| 94 |
|
| 95 |
weights_path = hf_hub_download(repo_id=repo_id, filename="pytorch_model.bin")
|
|
|
|
| 172 |
|
| 173 |
if __name__ == "__main__":
|
| 174 |
detector = AICodeDetector()
|
| 175 |
+
print("\n",detector.analyze(sample))
|
| 176 |
```
|