bug: requirement and name is team
Browse files- app.py +2 -2
- db.py +4 -2
- requirements.txt +83 -4
app.py
CHANGED
|
@@ -412,10 +412,10 @@ with gr.Blocks(
|
|
| 412 |
visible=True,
|
| 413 |
),
|
| 414 |
}
|
| 415 |
-
db.insert("prompts", {"
|
| 416 |
# Initialize estimates for the newly submitted prompt
|
| 417 |
all_prompts = db.load("prompts")
|
| 418 |
-
prompt_id = all_prompts[all_prompts["
|
| 419 |
ARENA.init_estimates(prompt_id)
|
| 420 |
return {
|
| 421 |
submit_prompt_btn: gr.update(interactive=False),
|
|
|
|
| 412 |
visible=True,
|
| 413 |
),
|
| 414 |
}
|
| 415 |
+
db.insert("prompts", {"team": f"{user_state['team']}", "text": prompt_text})
|
| 416 |
# Initialize estimates for the newly submitted prompt
|
| 417 |
all_prompts = db.load("prompts")
|
| 418 |
+
prompt_id = all_prompts[all_prompts["team"] == user_state["team"]].iloc[0]["id"]
|
| 419 |
ARENA.init_estimates(prompt_id)
|
| 420 |
return {
|
| 421 |
submit_prompt_btn: gr.update(interactive=False),
|
db.py
CHANGED
|
@@ -53,11 +53,13 @@ def insert(table_name: str, data: dict) -> None:
|
|
| 53 |
"""Inserts data into the specified table.
|
| 54 |
Id is automatically generated .
|
| 55 |
example:
|
| 56 |
-
db.insert("prompts", {"
|
| 57 |
"""
|
| 58 |
df = load(table_name)
|
| 59 |
data["id"] = 1 if df.empty else df["id"].max() + 1
|
| 60 |
-
df = pd.concat(
|
|
|
|
|
|
|
| 61 |
df.to_csv(DATABASE[table_name]["filename"], index=False)
|
| 62 |
|
| 63 |
|
|
|
|
| 53 |
"""Inserts data into the specified table.
|
| 54 |
Id is automatically generated .
|
| 55 |
example:
|
| 56 |
+
db.insert("prompts", {"team": "Test", "text": "This is a test prompt."})
|
| 57 |
"""
|
| 58 |
df = load(table_name)
|
| 59 |
data["id"] = 1 if df.empty else df["id"].max() + 1
|
| 60 |
+
df = pd.concat(
|
| 61 |
+
[df if not df.empty else None, pd.DataFrame([data])], ignore_index=True
|
| 62 |
+
)
|
| 63 |
df.to_csv(DATABASE[table_name]["filename"], index=False)
|
| 64 |
|
| 65 |
|
requirements.txt
CHANGED
|
@@ -1,4 +1,83 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
aiofiles==24.1.0
|
| 2 |
+
annotated-types==0.7.0
|
| 3 |
+
anyio==4.9.0
|
| 4 |
+
appnope==0.1.4
|
| 5 |
+
asttokens==3.0.0
|
| 6 |
+
certifi==2025.6.15
|
| 7 |
+
charset-normalizer==3.4.2
|
| 8 |
+
click==8.2.1
|
| 9 |
+
comm==0.2.2
|
| 10 |
+
debugpy==1.8.14
|
| 11 |
+
decorator==5.2.1
|
| 12 |
+
executing==2.2.0
|
| 13 |
+
fastapi==0.115.13
|
| 14 |
+
ffmpy==0.6.0
|
| 15 |
+
filelock==3.18.0
|
| 16 |
+
fsspec==2025.5.1
|
| 17 |
+
gradio==5.34.2
|
| 18 |
+
gradio_client==1.10.3
|
| 19 |
+
groovy==0.1.2
|
| 20 |
+
h11==0.16.0
|
| 21 |
+
hf-xet==1.1.5
|
| 22 |
+
httpcore==1.0.9
|
| 23 |
+
httpx==0.28.1
|
| 24 |
+
huggingface-hub==0.33.0
|
| 25 |
+
idna==3.10
|
| 26 |
+
ipykernel==6.29.5
|
| 27 |
+
ipython==9.3.0
|
| 28 |
+
ipython_pygments_lexers==1.1.1
|
| 29 |
+
jedi==0.19.2
|
| 30 |
+
Jinja2==3.1.6
|
| 31 |
+
jupyter_client==8.6.3
|
| 32 |
+
jupyter_core==5.8.1
|
| 33 |
+
markdown-it-py==3.0.0
|
| 34 |
+
MarkupSafe==3.0.2
|
| 35 |
+
matplotlib-inline==0.1.7
|
| 36 |
+
mdurl==0.1.2
|
| 37 |
+
narwhals==1.44.0
|
| 38 |
+
nest-asyncio==1.6.0
|
| 39 |
+
numpy==2.3.1
|
| 40 |
+
orjson==3.10.18
|
| 41 |
+
packaging==25.0
|
| 42 |
+
pandas==2.3.0
|
| 43 |
+
parso==0.8.4
|
| 44 |
+
pexpect==4.9.0
|
| 45 |
+
pillow==11.2.1
|
| 46 |
+
platformdirs==4.3.8
|
| 47 |
+
plotly==6.1.2
|
| 48 |
+
prompt_toolkit==3.0.51
|
| 49 |
+
psutil==7.0.0
|
| 50 |
+
ptyprocess==0.7.0
|
| 51 |
+
pure_eval==0.2.3
|
| 52 |
+
pydantic==2.11.7
|
| 53 |
+
pydantic_core==2.33.2
|
| 54 |
+
pydub==0.25.1
|
| 55 |
+
Pygments==2.19.2
|
| 56 |
+
python-dateutil==2.9.0.post0
|
| 57 |
+
python-multipart==0.0.20
|
| 58 |
+
pytz==2025.2
|
| 59 |
+
PyYAML==6.0.2
|
| 60 |
+
pyzmq==27.0.0
|
| 61 |
+
requests==2.32.4
|
| 62 |
+
rich==14.0.0
|
| 63 |
+
ruff==0.12.0
|
| 64 |
+
safehttpx==0.1.6
|
| 65 |
+
semantic-version==2.10.0
|
| 66 |
+
shellingham==1.5.4
|
| 67 |
+
six==1.17.0
|
| 68 |
+
sniffio==1.3.1
|
| 69 |
+
stack-data==0.6.3
|
| 70 |
+
starlette==0.46.2
|
| 71 |
+
tomlkit==0.13.3
|
| 72 |
+
tornado==6.5.1
|
| 73 |
+
tqdm==4.67.1
|
| 74 |
+
traitlets==5.14.3
|
| 75 |
+
trueskill==0.4.5
|
| 76 |
+
typer==0.16.0
|
| 77 |
+
typing-inspection==0.4.1
|
| 78 |
+
typing_extensions==4.14.0
|
| 79 |
+
tzdata==2025.2
|
| 80 |
+
urllib3==2.5.0
|
| 81 |
+
uvicorn==0.34.3
|
| 82 |
+
wcwidth==0.2.13
|
| 83 |
+
websockets==15.0.1
|