Dr-P commited on
Commit
7b2dde7
·
verified ·
1 Parent(s): e21fd64

Upload README (1).md

Browse files
Files changed (1) hide show
  1. README (1).md +110 -0
README (1).md ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Quote Request Handler MVP
3
+ emoji: 🧾
4
+ colorFrom: indigo
5
+ colorTo: blue
6
+ sdk: gradio
7
+ app_file: app.py
8
+ python_version: "3.10"
9
+ pinned: false
10
+ ---
11
+
12
+ # Quote Request Handler MVP
13
+
14
+ A Hugging Face Gradio Space for handling quote requests today while building a cleaner training dataset for tomorrow.
15
+
16
+ ## What this MVP does
17
+
18
+ This app treats your workbook as both:
19
+
20
+ 1. a **quote-request handler** for current intake, and
21
+ 2. a **supervised learning dataset** for a future ML model.
22
+
23
+ It uses your core schema on `Sheet1`:
24
+
25
+ - **Column A — `Request`**: the incoming customer request
26
+ - **Column B — `Information Extracted`**: subject matter expert knowledge, domain interpretation, or normalized technical context
27
+ - **Column C — `Design`**: quote-facing design guidance that should influence the final quote
28
+
29
+ It also supports a separate `SME_Notes` sheet for broader business/domain notes that should influence generations across all requests.
30
+
31
+ ## Why your Space failed to build before
32
+
33
+ In a Hugging Face Space, metadata is read from the YAML block at the top of `README.md`, and `python_version` is defined as a string field. Keeping it quoted avoids YAML coercing `3.10` into `3.1`, which can trigger the `python:3.1 not found` build error. citeturn996945search0turn996945search12
34
+
35
+ This MVP fixes that by using:
36
+
37
+ ```yaml
38
+ python_version: "3.10"
39
+ ```
40
+
41
+ ## Files
42
+
43
+ - `app.py` — main Gradio app
44
+ - `requirements.txt` — Python dependencies
45
+ - `data/quote_request_training.xlsx` — seed workbook used if no persisted workbook exists yet
46
+
47
+ ## Hugging Face Space setup
48
+
49
+ Create a **Gradio Space** and upload these files.
50
+
51
+ Then add this **Secret** in the Space settings:
52
+
53
+ - `ANTHROPIC_API_KEY`
54
+
55
+ Optional environment variable:
56
+
57
+ - `CLAUDE_MODEL` — defaults to `claude-sonnet-4-6`
58
+
59
+ The app uses Anthropic's Messages API via the Python SDK. Anthropic’s current examples use `Anthropic(...).messages.create(...)`, which is the pattern used in this MVP. citeturn996945search7turn996945search19
60
+
61
+ ## Hardware recommendation
62
+
63
+ This MVP does **not require a GPU** because the model inference happens remotely through Anthropic’s API, while the Space itself mainly handles form input, workbook I/O, retrieval, and response rendering. Start on a CPU Space unless you later add local embedding models, local rerankers, or local generation. Hugging Face documents both standard GPU upgrades and ZeroGPU for workloads that actually perform local GPU computation. citeturn996945search6turn996945search2
64
+
65
+ ## Persistence
66
+
67
+ The app automatically uses `/data/quote_request_handler` when `/data` is available, which is the path Hugging Face uses for attached persistent storage. If persistent storage is not attached, it falls back to the repository `./data` folder. citeturn996945search1
68
+
69
+ ## Main workflow
70
+
71
+ ### 1) Generate Quote Guidance
72
+
73
+ Use the generation tab to:
74
+ - paste a new customer request
75
+ - optionally add SME/domain notes for that request
76
+ - retrieve similar historical rows
77
+ - generate:
78
+ - `information_extracted`
79
+ - `design`
80
+ - structured `quote_inputs`
81
+ - `assumptions`
82
+
83
+ ### 2) Add Data to Column A or Column B
84
+
85
+ The intake/curation tab lets you:
86
+ - append a **request-only** row to Column A
87
+ - append a **full A/B/C row**
88
+ - append new **SME knowledge** to Column B for an existing row
89
+ - edit any existing row
90
+ - add reusable **global SME notes** for all future generations
91
+
92
+ ### 3) Build the future ML dataset
93
+
94
+ The export tools produce:
95
+ - **CSV** for analysis and training prep
96
+ - **JSONL** for later fine-tuning, distillation, or evaluation pipelines
97
+
98
+ ## Future ML architecture
99
+
100
+ This MVP supports the progression you described:
101
+
102
+ - **Near term**: retrieval + Anthropic generation
103
+ - **Mid term**: use accepted quote outcomes as labeled targets
104
+ - **Later**: train a dedicated model where `(Request, SME knowledge) -> Design/quote guidance`
105
+
106
+ ## Notes
107
+
108
+ - The first worksheet should contain the headers: `Request`, `Information Extracted`, `Design`
109
+ - Additional sheets are preserved when you replace the workbook
110
+ - The app includes a JSON repair pass if the model returns malformed JSON