Refactor everything (#3481)

This commit is contained in:
oobabooga 2023-08-06 21:49:27 -03:00 committed by GitHub
parent d4b851bdc8
commit 65aa11890f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 1306 additions and 1178 deletions

View file

@ -1,4 +1,3 @@
import json
from pathlib import Path
import gradio as gr
@ -11,9 +10,9 @@ with open(Path(__file__).resolve().parent / '../css/main.css', 'r') as f:
css = f.read()
with open(Path(__file__).resolve().parent / '../css/chat.css', 'r') as f:
chat_css = f.read()
with open(Path(__file__).resolve().parent / '../css/main.js', 'r') as f:
with open(Path(__file__).resolve().parent / '../js/main.js', 'r') as f:
main_js = f.read()
with open(Path(__file__).resolve().parent / '../css/save_files.js', 'r') as f:
with open(Path(__file__).resolve().parent / '../js/save_files.js', 'r') as f:
save_files_js = f.read()
refresh_symbol = '🔄'
@ -30,6 +29,11 @@ theme = gr.themes.Default(
background_fill_secondary='#eaeaea'
)
if Path("notification.mp3").exists():
audio_notification_js = "document.querySelector('#audio_notification audio')?.play();"
else:
audio_notification_js = ""
def list_model_elements():
elements = [