Spaces:
Sleeping
Sleeping
Commit
·
c574a7f
1
Parent(s):
4ade37a
feat: add team_id for RLS policy
Browse files
app.py
CHANGED
|
@@ -57,7 +57,7 @@ def classify_pairs(model, tokenizer, prompts, responses):
|
|
| 57 |
|
| 58 |
|
| 59 |
@spaces.GPU()
|
| 60 |
-
def generate(submission: list[dict[str, str]]) -> list[dict[str, str | float]]:
|
| 61 |
ids = [s["id"] for s in submission]
|
| 62 |
prompts = [s["prompt"] for s in submission]
|
| 63 |
|
|
@@ -65,7 +65,7 @@ def generate(submission: list[dict[str, str]]) -> list[dict[str, str | float]]:
|
|
| 65 |
scores = classify_pairs(moderator_model, moderator_tokenizer, prompts, responses)
|
| 66 |
|
| 67 |
return [
|
| 68 |
-
{"id": id, "prompt": prompt, "response": response, "score": score, "model": chat_model_name}
|
| 69 |
for id, prompt, response, score in zip(ids, prompts, responses, scores)
|
| 70 |
]
|
| 71 |
|
|
|
|
| 57 |
|
| 58 |
|
| 59 |
@spaces.GPU()
|
| 60 |
+
def generate(submission: list[dict[str, str]], team_id) -> list[dict[str, str | float]]:
|
| 61 |
ids = [s["id"] for s in submission]
|
| 62 |
prompts = [s["prompt"] for s in submission]
|
| 63 |
|
|
|
|
| 65 |
scores = classify_pairs(moderator_model, moderator_tokenizer, prompts, responses)
|
| 66 |
|
| 67 |
return [
|
| 68 |
+
{"id": id, "prompt": prompt, "response": response, "score": score, "model": chat_model_name, "team_id": team_id}
|
| 69 |
for id, prompt, response, score in zip(ids, prompts, responses, scores)
|
| 70 |
]
|
| 71 |
|