Spaces:
Sleeping
A newer version of the Gradio SDK is available: 6.11.0
title: Chatbot Mimic Notes
emoji: 🤖
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 3.50.2
app_file: chatgpt.py
pinned: false
license: mit
python_version: 3.11
Chatbot Mimic Notes
A medical-focused chatbot that supports patient evaluations, structured conversation management, and optional Google Drive backups.
Need to customize the Hugging Face Space configuration? See the reference guide at https://huggingface.co/docs/hub/spaces-config-reference.
Prerequisites
- Python 3.x
- pip
Installation
Clone this repository
Navigate to the project directory:
cd chatbot-mimic-notesInstall the required packages:
pip install -r requirements.txt
Running the Application
Start the chatbot by running:
python chatgpt.py
Run Server
python -m src.server
Usage
- Open Chrome and visit
http://localhost:7860to interact with the chatbot.
Google Drive Auto-Backup
The chatbot can automatically push evaluation data to Google Drive so the latest files are available when deploying to Hugging Face.
Storage Layout
Patient evaluations (
patient_evaluations/)- Synced to the
Patient_Evaluationsfolder in Drive - Includes per-evaluation JSON files plus the master CSV summary
- Synced to the
Conversation logs (
user_data/)- Synced to the
Chatbot_Conversationsfolder in Drive - Includes conversation transcripts and memory graphs
- Synced to the
Configuration Options (choose one)
⭐ Option 1: Service Account (recommended)
Use this if you see an invalid_client error or want a hands-off setup.
- Create a Service Account in Google Cloud Console and download the JSON key
- Share your destination Drive folder with the Service Account email
- Update
google_drive_sync.py:SERVICE_ACCOUNT_FILE = "service-account-key.json"
Full walkthrough (≈5 minutes): see QUICK_SETUP.md
Option 2: Refresh Token (requires an OAuth client)
- Generate a refresh token:
python get_refresh_token.py - If you hit
invalid_client, create a new OAuth client (seeQUICK_SETUP.md) - Complete the browser authentication flow
- Copy the printed
refresh_token - Update
google_drive_sync.py:REFRESH_TOKEN = "your_refresh_token"
See google_drive_setup_guide.md or QUICK_SETUP.md for detailed steps.
Option 3: Interactive OAuth (manual in UI)
- Click “Login to Google Drive” inside the Gradio interface
- Complete the browser authentication
- Future saves will automatically sync to Drive
Notes
- Without authentication, all files remain in local storage
- Upload failures are silent but local saves always succeed
- Only your own Drive account receives files; no shared storage is involved
- Security: never commit credentials or tokens into the repo