Duskfallcrew commited on
Commit
804d4e4
ยท
verified ยท
1 Parent(s): 5b28d86

Update app.py

Browse files

Trying to get it to work, sorry my commit messages are slack
Key Changes and Explanations:

CSS Styling:

The CSS is now correctly passed as a string to the css parameter of gr.Blocks().

I've added an elem_id="main-container" to a gr.Column that wraps the input components and the button. This is important because the CSS targets #main-container to control the layout. Without this, the CSS wouldn't apply correctly.

Markdown Content:

The Markdown content is integrated using gr.Markdown().

I've made some minor formatting improvements:

Used more specific headings (e.g., "### ๐Ÿ“ฅ Input Sources Supported:").

Used bold text (**) to highlight important points (like "CPU" and "WRITE").

Added Markdown links for the Hugging Face token page, the GitHub repository, and the Ko-fi page. The format is [Link Text](URL).

gr.Column: Using a gr.Column with elem_id="main-container" is crucial for applying the CSS that controls the layout (making the button stick to the bottom).

No other code changes: Functionality remains the same.

Key Changes in this Complete Code:

cached_download Import Removed: The unnecessary import of cached_download is removed.

get_from_cache Used Correctly: The download_model function now correctly uses get_from_cache to check for cached URLs.

Manual Download and Caching: If a URL is not cached, the code downloads it using requests, determines a filename, and saves it to the standard Hugging Face cache directory (HUGGINGFACE_HUB_CACHE).

HF Cache dir: Downloads now go to the correct HF cache, inside a subfolder called "downloads".

HUGGINGFACE_HUB_CACHE Imported: The constant for the cache directory is imported.

1 file changed +178 -50
app.py+178-50