Spaces:
Running
Running
Commit
·
54f81d8
1
Parent(s):
c8c52e3
Increased Temperature
Browse files- model/analyzer.py +8 -12
model/analyzer.py
CHANGED
@@ -106,27 +106,23 @@ class ContentAnalyzer:
|
|
106 |
**inputs,
|
107 |
max_new_tokens=5,
|
108 |
do_sample=True,
|
109 |
-
temperature=0.
|
110 |
top_p=0.9,
|
111 |
pad_token_id=self.tokenizer.eos_token_id
|
112 |
)
|
113 |
|
114 |
response_text = self.tokenizer.decode(outputs[0], skip_special_tokens=True).strip().upper()
|
|
|
|
|
115 |
|
116 |
-
|
117 |
-
|
118 |
-
print(f"{' ' * 16}Detected {mapped_name} in this chunk!")
|
119 |
chunk_triggers[mapped_name] = chunk_triggers.get(mapped_name, 0) + 1
|
120 |
-
elif "MAYBE"
|
121 |
-
print(f"
|
122 |
chunk_triggers[mapped_name] = chunk_triggers.get(mapped_name, 0) + 0.5
|
123 |
else:
|
124 |
-
print(f"
|
125 |
-
|
126 |
-
if progress:
|
127 |
-
current_progress += progress_step
|
128 |
-
progress(min(current_progress, 0.9), f"{' ' * 16}Analyzing {mapped_name}...")
|
129 |
-
|
130 |
|
131 |
if progress:
|
132 |
current_progress += progress_step
|
|
|
106 |
**inputs,
|
107 |
max_new_tokens=5,
|
108 |
do_sample=True,
|
109 |
+
temperature=0.6,
|
110 |
top_p=0.9,
|
111 |
pad_token_id=self.tokenizer.eos_token_id
|
112 |
)
|
113 |
|
114 |
response_text = self.tokenizer.decode(outputs[0], skip_special_tokens=True).strip().upper()
|
115 |
+
first_word = response_text.split("\n")[-1].split()[0] if response_text else "NO"
|
116 |
+
print(f"Model response for {mapped_name}: {first_word}")
|
117 |
|
118 |
+
if first_word == "YES":
|
119 |
+
print(f"Detected {mapped_name} in this chunk!")
|
|
|
120 |
chunk_triggers[mapped_name] = chunk_triggers.get(mapped_name, 0) + 1
|
121 |
+
elif first_word == "MAYBE":
|
122 |
+
print(f"Possible {mapped_name} detected, marking for further review.")
|
123 |
chunk_triggers[mapped_name] = chunk_triggers.get(mapped_name, 0) + 0.5
|
124 |
else:
|
125 |
+
print(f"No {mapped_name} detected in this chunk.")
|
|
|
|
|
|
|
|
|
|
|
126 |
|
127 |
if progress:
|
128 |
current_progress += progress_step
|