replace theme
Build-Deploy-Actions Details

This commit is contained in:
jianjiang 2023-04-21 17:09:50 +08:00
parent b93b9dba15
commit b6ffc33c64
1 changed files with 10 additions and 1 deletions

11
app.py
View File

@ -2,6 +2,15 @@ from PIL import Image
import gradio as gr
from transformers import ViTFeatureExtractor, ViTForImageClassification
import torch
from gradio.themes.utils import sizes
theme = gr.themes.Default(radius_size=sizes.radius_none).set(
block_label_text_color = '#4D63FF',
block_title_text_color = '#4D63FF',
button_primary_text_color = '#4D63FF',
button_primary_background_fill='#FFFFFF',
button_primary_border_color='#4D63FF',
button_primary_background_fill_hover='#EDEFFF',
)
# Init model, transforms
model = ViTForImageClassification.from_pretrained('nateraw/vit-age-classifier')
@ -43,5 +52,5 @@ gr.Interface(
description=description,
article=article,
examples=examples,
theme="huggingface",
theme=theme,
).launch(debug=True, enable_queue=True)