Skip to content

Commit 5237898

Browse files
v10.1
- Bug fixes
1 parent c766f15 commit 5237898

File tree

5 files changed

+3
-8
lines changed

5 files changed

+3
-8
lines changed
48 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

AI/aiScoring.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ def score(_in, device, test: int = 1, inputSize: int = 16, hx: int = 32, outputS
66
startTimer = time.perf_counter()
77
startTimer2 = time.process_time()
88

9-
change = 0 # Placeholder for HuggingFace
10-
119
if test == 1:
1210
SimpleNeuralNet(inputSize, hx, outputSize).to(device)(_in)
1311
elif test == 2:
@@ -24,5 +22,5 @@ def score(_in, device, test: int = 1, inputSize: int = 16, hx: int = 32, outputS
2422
endTimer2 = time.process_time()
2523

2624
totalTime = (endTimer - startTimer) + (endTimer2 - startTimer2)
27-
points = (1000 // totalTime * 0.1) + change
25+
points = (1000 // totalTime * 0.1)
2826
return f"AI Score: {points} | Time Taken: {totalTime}s"

AI/aiTests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from torch import nn
2+
from transformers import pipeline
23

34

45
class SimpleNeuralNet(nn.Module):
@@ -68,6 +69,5 @@ def __init__(self, modelName: str = "google/gemma-3-270m", device: str = "cpu",
6869
self.type = type
6970

7071
def model(self, data):
71-
from transformers import pipeline
7272
pipe = pipeline(self.type, self.modelName, device=self.device)(data)
7373
return pipe

ScoringSysCMD.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ def terminal(l = [], a = 0, b = 0, l2 = []):
4444
elif whichAI == "LargeNeuralNet" or whichAI == "3":
4545
return score(data, device, test=3, inputSize=inputSize, hx=hx, outputSize=outputSize, numLayers=numLayers)
4646
elif whichAI == "HuggingFace" or whichAI == "4":
47-
usePrompt = input("Use a Custom Prompt? [y/n]: ")
48-
if usePrompt == "y":
49-
prompt = input("Enter Your Prompt [string/list]: ")
50-
data = prompt
47+
data = input("Prompt: ")
5148
modelName = input("HuggingFace Model Name (Default google/gemma-3-270m): ") or "google/gemma-3-270m"
5249
modelType = input("HuggingFace Model Type (Default text-generation): ") or "text-generation"
5350
return score(data, device, test=4, inputSize=inputSize, hx=0, outputSize=1, model=modelName, type=modelType)

0 commit comments

Comments
 (0)