Spaces:
Running
on
Zero
Running
on
Zero
app.py
CHANGED
@@ -125,7 +125,6 @@ TECHNIQUE_LIST = [
|
|
125 |
]
|
126 |
|
127 |
|
128 |
-
@spaces.GPU(duration=120)
|
129 |
@torch.no_grad()
|
130 |
def phrase_log_prob(prompt, phrase):
|
131 |
"""Calculate log probability of a phrase given a prompt using the language model."""
|
@@ -250,6 +249,7 @@ def campaign_actor_probs(campaigns, actors, prompt_template="is conducted by"):
|
|
250 |
return pd.DataFrame.from_dict(rows, orient="index")
|
251 |
|
252 |
|
|
|
253 |
def generate_actor_heatmap(c_list, a_list, actor_prompt_template):
|
254 |
"""Generate Campaign-Actor association heatmap with probability visualization."""
|
255 |
try:
|
@@ -314,6 +314,7 @@ def generate_actor_heatmap(c_list, a_list, actor_prompt_template):
|
|
314 |
return fig
|
315 |
|
316 |
|
|
|
317 |
def generate_technique_heatmap(c_list, t_list, technique_prompt_template, technique_neg_template):
|
318 |
"""Generate Campaign-Technique association heatmap with binary scoring visualization."""
|
319 |
try:
|
|
|
125 |
]
|
126 |
|
127 |
|
|
|
128 |
@torch.no_grad()
|
129 |
def phrase_log_prob(prompt, phrase):
|
130 |
"""Calculate log probability of a phrase given a prompt using the language model."""
|
|
|
249 |
return pd.DataFrame.from_dict(rows, orient="index")
|
250 |
|
251 |
|
252 |
+
@spaces.GPU(duration=120)
|
253 |
def generate_actor_heatmap(c_list, a_list, actor_prompt_template):
|
254 |
"""Generate Campaign-Actor association heatmap with probability visualization."""
|
255 |
try:
|
|
|
314 |
return fig
|
315 |
|
316 |
|
317 |
+
@spaces.GPU(duration=120)
|
318 |
def generate_technique_heatmap(c_list, t_list, technique_prompt_template, technique_neg_template):
|
319 |
"""Generate Campaign-Technique association heatmap with binary scoring visualization."""
|
320 |
try:
|