Spaces:
Runtime error
Runtime error
Sohini Mallick commited on
Commit ·
6f6b886
1
Parent(s): 7d0d727
README
Browse files- .gitignore +1 -1
- LICENSE +21 -0
- README.md +48 -0
.gitignore
CHANGED
|
@@ -8,4 +8,4 @@ __pycache__/
|
|
| 8 |
.vscode/
|
| 9 |
.DS_Store
|
| 10 |
*.log
|
| 11 |
-
|
|
|
|
| 8 |
.vscode/
|
| 9 |
.DS_Store
|
| 10 |
*.log
|
| 11 |
+
.gradio
|
LICENSE
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2025 <Sohini Mallick>
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the “Software”), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
README.md
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HeritageScribe
|
| 2 |
+
|
| 3 |
+
HeritageScribe is a lightweight web application for creating AI‑generated catalogue entries and conservation assessments of archaeological sites and artworks. Users upload an image, provide a few details, and the Gemma3n language model streams back structured Markdown text in real time. The app is built with [Gradio](https://www.gradio.app/) and runs the `unsloth/gemma-3n-E2B-it` model in 4‑bit mode for efficient inference.
|
| 4 |
+
|
| 5 |
+
## Features
|
| 6 |
+
|
| 7 |
+
- **Home** – introduction and instructions for new users.
|
| 8 |
+
- **Generate** – upload an image and generate two types of reports:
|
| 9 |
+
- **Catalogue Entry** with sections for visual description, artistic details, cultural context, comparisons, and a JSON field log.
|
| 10 |
+
- **Conservation Assessment** with damage and recommendation notes.
|
| 11 |
+
Generation parameters (temperature, beam search, and max tokens) are adjustable.
|
| 12 |
+
- **Dashboard** – displays all generated entries in one place for easy review.
|
| 13 |
+
|
| 14 |
+
## Installation
|
| 15 |
+
|
| 16 |
+
1. Clone this repository.
|
| 17 |
+
2. Install Python 3.10 or later.
|
| 18 |
+
3. Install the dependencies:
|
| 19 |
+
```bash
|
| 20 |
+
pip install -r requirements.txt
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
A CUDA‑capable GPU is recommended for running the model.
|
| 24 |
+
|
| 25 |
+
## Usage
|
| 26 |
+
|
| 27 |
+
Launch the Gradio interface with:
|
| 28 |
+
|
| 29 |
+
```bash
|
| 30 |
+
python app.py
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
Open the provided local URL in your browser. From the **Generate** tab you can fill in site details, upload a heritage image, and start generating. Results are streamed to the page and stored so you can view them later in the **Dashboard** tab.
|
| 34 |
+
|
| 35 |
+
## Project Layout
|
| 36 |
+
|
| 37 |
+
- `app.py` – entry point that creates the Gradio interface.
|
| 38 |
+
- `helpers/` – UI components and utility classes.
|
| 39 |
+
- `templates/` – text templates that build prompts for the Gemma model.
|
| 40 |
+
- `requirements.txt` – Python package requirements.
|
| 41 |
+
|
| 42 |
+
## License
|
| 43 |
+
|
| 44 |
+
See the `LICENSE` file for licensing information.
|
| 45 |
+
|
| 46 |
+
## Contributing
|
| 47 |
+
|
| 48 |
+
Contributions and issues are welcome. Feel free to open a pull request or file an issue if you encounter problems or have suggestions.
|