Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,11 +1,85 @@
|
|
| 1 |
---
|
| 2 |
-
title: Prompt Tester
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk:
|
|
|
|
|
|
|
| 7 |
pinned: false
|
| 8 |
-
license:
|
| 9 |
---
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Prompt A/B Tester
|
| 3 |
+
emoji: 🔬
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: 1.28.0
|
| 8 |
+
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
license: mit
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# Prompt A/B Tester
|
| 14 |
+
|
| 15 |
+
Web application for testing and comparing the performance of two OpenAI GPT prompt versions with A/B testing methodology.
|
| 16 |
+
|
| 17 |
+
## Features
|
| 18 |
+
|
| 19 |
+
- **API Key Management**: Securely store OpenAI API key in Streamlit secrets
|
| 20 |
+
- **Model Selection**: Choose from available GPT models (gpt-4o, gpt-4, gpt-3.5-turbo)
|
| 21 |
+
- **Parameter Configuration**:
|
| 22 |
+
- Temperature (0.0 - 2.0)
|
| 23 |
+
- Max Tokens (100 - 4000)
|
| 24 |
+
- Number of responses (1-50)
|
| 25 |
+
- **Two Input Methods**:
|
| 26 |
+
- Upload `.md` or `.txt` files
|
| 27 |
+
- Paste text directly
|
| 28 |
+
- **Progress Tracking**: Real-time progress bars and logs
|
| 29 |
+
- **Interactive Rating**: Rate responses on a 1-5 scale
|
| 30 |
+
- **Results Visualization**: Compare prompts with statistics
|
| 31 |
+
- **CSV Export**: Download results with metadata
|
| 32 |
+
|
| 33 |
+
## Usage
|
| 34 |
+
|
| 35 |
+
### 1. Configuration
|
| 36 |
+
|
| 37 |
+
1. Go to "⚙️ Configuration" tab
|
| 38 |
+
2. Enter your OpenAI API key
|
| 39 |
+
3. Select model and adjust parameters
|
| 40 |
+
4. Save settings
|
| 41 |
+
|
| 42 |
+
### 2. Run Test
|
| 43 |
+
|
| 44 |
+
1. Go to "🚀 Test" tab
|
| 45 |
+
2. Either upload two files OR paste two prompts
|
| 46 |
+
3. Click "Run Test"
|
| 47 |
+
4. Monitor progress
|
| 48 |
+
|
| 49 |
+
### 3. Rate Responses
|
| 50 |
+
|
| 51 |
+
1. After generation, go to "⭐ Rating" tab
|
| 52 |
+
2. Rate each response (1-5)
|
| 53 |
+
3. Click "Calculate Results"
|
| 54 |
+
|
| 55 |
+
### 4. View Results
|
| 56 |
+
|
| 57 |
+
1. Review statistics in "📊 Results" tab
|
| 58 |
+
2. Export to CSV if needed
|
| 59 |
+
|
| 60 |
+
## Configuration on Hugging Face Spaces
|
| 61 |
+
|
| 62 |
+
To use this app on Hugging Face Spaces:
|
| 63 |
+
|
| 64 |
+
1. Go to Settings → Repository secrets
|
| 65 |
+
2. Add a new secret:
|
| 66 |
+
- **Name**: `OPENAI_API_KEY`
|
| 67 |
+
- **Value**: Your OpenAI API key
|
| 68 |
+
|
| 69 |
+
## Cost Estimation
|
| 70 |
+
|
| 71 |
+
Approximate costs per test (2025 pricing):
|
| 72 |
+
|
| 73 |
+
| Model | 10 responses (5A + 5B) | 20 responses (10A + 10B) |
|
| 74 |
+
|-------|------------------------|---------------------------|
|
| 75 |
+
| gpt-4o | ~$0.05 | ~$0.10 |
|
| 76 |
+
| gpt-4-turbo | ~$0.15 | ~$0.30 |
|
| 77 |
+
| gpt-4 | ~$0.30 | ~$0.60 |
|
| 78 |
+
| gpt-3.5-turbo | ~$0.01 | ~$0.02 |
|
| 79 |
+
|
| 80 |
+
## Project Information
|
| 81 |
+
|
| 82 |
+
**Version**: 2.0 (Streamlit)
|
| 83 |
+
**Original Project**: Manuscripto - Medical Editorial Assistant
|
| 84 |
+
**Created**: 2025-10-14
|
| 85 |
+
**License**: MIT
|