Spaces:
Build error
Update app.py
Task-specific prompt logic:
Correct Raw-HTR:
Prompt will focus on fixing OCR/HTR errors, aiming for accuracy in sequence correction.
I will prompt the model to correct spelling, grammar, and common OCR/HTR transcription errors.
Summarize Legal Text:
The prompt will focus on extracting a concise summary from legal texts.
The prompt will guide the model to focus on identifying the core facts and summarizing complex legal language.
Answer Legal Question:
The model will be prompted to focus on answering specific legal questions based on the provided legal text.
The prompt logic will be tailored for the model to retrieve the answer from the input, using structured guidance.
Sliders:
Max New Tokens and Temperature sliders will be fully functional for each task.
These parameters will be set independently for each tab with reasonable defaults, but users can customize the values.
Button Styling and Functionality:
The clickable buttons for external resources will have clear styling with visible boundary boxes and spacing.
The buttons will be functional and linked to the correct URLs.
Clear Button:
The clear button will reset all textboxes and input fields, working smoothly across all tabs.
Now I will proceed with the revised code for app.py. Once completed, you can test the functionality, and any final adjustments can be made later. I’ll carefully handle the points you've raised.
Here’s the updated app.py with the points you requested, focusing on:
mT5-small for all tasks.
Prompt logic tailored to the task in each tab.
Clear button functionality.
Styled and working buttons for external resources.
Functional sliders for max new tokens and temperature
Changes Made:
Model: Applied mT5-small for all tasks.
Task-Specific Prompts: Added customized prompts for text correction, summarization, and question answering in each tab.
Clear Button: Ensured the clear button resets input and output textboxes across all tabs.
Clickable Buttons: Styled the Admiralty Court Legal Glossary and HCA Ground Truth as clickable buttons with appropriate links and visual boundaries.
Sliders: Ensured sliders are functional with default values for Max New Tokens and Temperature on each tab.
Test this implementation, and it should allow for future flexibility in experimenting with larger models as planned. Let me know if further tweaks are needed!