Spaces:
Sleeping
Sleeping
Delete complexity_score.py
Browse files- complexity_score.py +0 -41
complexity_score.py
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<<<<<<< HEAD
|
2 |
-
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
3 |
-
import torch
|
4 |
-
|
5 |
-
# Load the tokenizer and model
|
6 |
-
tokenizer = AutoTokenizer.from_pretrained("thethinkmachine/Maxwell-Task-Complexity-Scorer-v0.2")
|
7 |
-
model = AutoModelForSequenceClassification.from_pretrained("thethinkmachine/Maxwell-Task-Complexity-Scorer-v0.2")
|
8 |
-
|
9 |
-
# Example task
|
10 |
-
task_description = "find a new theory"
|
11 |
-
|
12 |
-
# Tokenize the input
|
13 |
-
inputs = tokenizer(task_description, return_tensors="pt")
|
14 |
-
|
15 |
-
# Perform inference
|
16 |
-
with torch.no_grad():
|
17 |
-
outputs = model(**inputs)
|
18 |
-
complexity_score = torch.sigmoid(outputs.logits).item()
|
19 |
-
|
20 |
-
print(f"Task Complexity Score: {complexity_score:.4f}")
|
21 |
-
=======
|
22 |
-
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
23 |
-
import torch
|
24 |
-
|
25 |
-
# Load the tokenizer and model
|
26 |
-
tokenizer = AutoTokenizer.from_pretrained("thethinkmachine/Maxwell-Task-Complexity-Scorer-v0.2")
|
27 |
-
model = AutoModelForSequenceClassification.from_pretrained("thethinkmachine/Maxwell-Task-Complexity-Scorer-v0.2")
|
28 |
-
|
29 |
-
# Example task
|
30 |
-
task_description = "find a new theory"
|
31 |
-
|
32 |
-
# Tokenize the input
|
33 |
-
inputs = tokenizer(task_description, return_tensors="pt")
|
34 |
-
|
35 |
-
# Perform inference
|
36 |
-
with torch.no_grad():
|
37 |
-
outputs = model(**inputs)
|
38 |
-
complexity_score = torch.sigmoid(outputs.logits).item()
|
39 |
-
|
40 |
-
print(f"Task Complexity Score: {complexity_score:.4f}")
|
41 |
-
>>>>>>> b1313c5d084e410cadf261f2fafd8929cb149a4f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|