similarity_analysis / RESTART_APP_INSTRUCTIONS.txt
DanJChong's picture
Upload folder using huggingface_hub
329d553 verified
================================================================================
HOW TO RESTART THE APP TO SEE NEW CHANGES
================================================================================
The GUI code has been modified, but Gradio/Python caches the old code.
You MUST restart the app to see the changes!
================================================================================
STEP 1: STOP THE CURRENT APP
================================================================================
If the app is running:
1. Go to the terminal/command window where app.py is running
2. Press: Ctrl+C (or Cmd+C on Mac)
3. Wait for it to say "Keyboard interrupt received, exiting."
4. Make sure the process fully stops
================================================================================
STEP 2: START THE APP FRESH
================================================================================
In the terminal:
cd C:\Users\danjc\OneDrive\Desktop\Research\language\similarity_analysis
python app.py
Wait for it to say:
"Running on local URL: http://127.0.0.1:7860"
================================================================================
STEP 3: OPEN IN BROWSER
================================================================================
1. Open browser (or refresh if already open)
2. Go to: http://localhost:7860
3. Make sure you see the GUI load fresh
================================================================================
STEP 4: TEST THE NEW METHOD 2
================================================================================
In the GUI:
1. ML Model dropdown: Select "AVERAGE - Neural Language (Captions)"
2. Brain Response Type: Select "Early Visual Average (7 ROIs)"
3. Look at the "Current Analysis" box
4. Find the line: "Brain and ML Model | **X.XXX** |"
5. What number do you see?
If you see: 0.208 or 0.207 or 0.21 --> SUCCESS! Method 2 is working!
If you see: 0.324 or 0.32 --> PROBLEM: Still using Method 1
================================================================================
STEP 5: CHECK THE CONSOLE OUTPUT
================================================================================
Look at the terminal where you ran "python app.py"
You should see debug output like:
[DEBUG generate_scatter]
ml_model_selection = avg_captions_neural
ml_model_selection type = <class 'str'>
Starts with 'avg_'? True
[METHOD 2] Using correlate-then-average for avg_captions_neural
Human vs Category: r = 0.XXXX
Brain vs Category: r = 0.2078
If you see this, Method 2 is working!
If you DON'T see this output, the code isn't being called or there's an issue.
================================================================================
TROUBLESHOOTING
================================================================================
PROBLEM: I still see 0.324
Solution 1: Make SURE you fully restarted
- Close the terminal window completely
- Open a NEW terminal window
- Run python app.py again
Solution 2: Check Python is loading the right files
- Run: python debug_gui_numbers.py
- If it shows Method 2 = 0.208, the code CAN work
- The issue is just the app not reloading
Solution 3: Clear Python cache
- Close app
- Delete __pycache__ folders:
- rm -rf visualization/__pycache__
- rm -rf data/__pycache__
- rm -rf gui/__pycache__
- Restart app
PROBLEM: I see a different number (not 0.324 or 0.208)
Tell me:
- Exact number you see
- Which model you selected
- Which brain measure you selected
- Copy the console output
I'll help debug!
================================================================================
EXPECTED RESULTS (After Restart)
================================================================================
Model: "AVERAGE - Neural Language (Captions)"
Brain Measure: "Early Visual Average (7 ROIs)"
--> Brain and ML Model: r = 0.208 βœ“
Brain Measure: "Late Semantic Average (12 ROIs)"
--> Brain and ML Model: r = 0.312 βœ“
Difference: +0.105 (matches bar chart!)
Model: "AVERAGE - Vision Models (Images)"
Brain Measure: "Early Visual Average (7 ROIs)"
--> Brain and ML Model: r = 0.200 βœ“
Brain Measure: "Late Semantic Average (12 ROIs)"
--> Brain and ML Model: r = 0.204 βœ“
Difference: +0.005 (matches bar chart!)
================================================================================
BOTTOM LINE
================================================================================
1. STOP the app (Ctrl+C)
2. START fresh (python app.py)
3. OPEN browser (localhost:7860)
4. TEST (select averages, check numbers)
5. VERIFY (should see 0.208, not 0.324)
If you still see 0.324 after a fresh restart, TELL ME and show me:
- The exact number
- The console output
- Screenshot if possible
I'll help fix it!
================================================================================