Spaces:
Sleeping
Sleeping
Rachel Kim commited on
Commit ·
cc62222
1
Parent(s): 0793785
add instructions
Browse files- README.md +5 -0
- ui/components.py +4 -1
README.md
CHANGED
|
@@ -9,3 +9,8 @@ pinned: false
|
|
| 9 |
---
|
| 10 |
|
| 11 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 12 |
+
|
| 13 |
+
How to set up the HuggingFace Space:
|
| 14 |
+
- Download the data from Qualtrics
|
| 15 |
+
- Run ```process_qualtrics_data.py```
|
| 16 |
+
- Replace ```CSV_FILE``` in ```ui/components.py``` with the new CSV file
|
ui/components.py
CHANGED
|
@@ -4,6 +4,9 @@ from urllib.parse import urlparse, parse_qs
|
|
| 4 |
import pandas as pd
|
| 5 |
|
| 6 |
|
|
|
|
|
|
|
|
|
|
| 7 |
def load_app(request: gr.Request):
|
| 8 |
prolific_id = request.query_params.get("prolific_id", "RACHEL_TEST") # TODO: change
|
| 9 |
# use prolific_id to determine which page to show, log it, etc.
|
|
@@ -11,7 +14,7 @@ def load_app(request: gr.Request):
|
|
| 11 |
|
| 12 |
|
| 13 |
def get_prompt_and_responses(prolific_id):
|
| 14 |
-
df = pd.read_csv(
|
| 15 |
filtered_df = df[df.prolific_id == prolific_id].iloc[0]
|
| 16 |
print(filtered_df["prompt"])
|
| 17 |
print(filtered_df["response_a"])
|
|
|
|
| 4 |
import pandas as pd
|
| 5 |
|
| 6 |
|
| 7 |
+
CSV_FILE = "20260302_174131_llm_responses.csv"
|
| 8 |
+
|
| 9 |
+
|
| 10 |
def load_app(request: gr.Request):
|
| 11 |
prolific_id = request.query_params.get("prolific_id", "RACHEL_TEST") # TODO: change
|
| 12 |
# use prolific_id to determine which page to show, log it, etc.
|
|
|
|
| 14 |
|
| 15 |
|
| 16 |
def get_prompt_and_responses(prolific_id):
|
| 17 |
+
df = pd.read_csv(CSV_FILE)
|
| 18 |
filtered_df = df[df.prolific_id == prolific_id].iloc[0]
|
| 19 |
print(filtered_df["prompt"])
|
| 20 |
print(filtered_df["response_a"])
|