fix theme folder rename problem
This commit is contained in:
		
							parent
							
								
									b308fde480
								
							
						
					
					
						commit
						fe231f72b6
					
				@ -12,7 +12,7 @@ def write_chat_to_file(chatbot, history=None, file_name=None):
 | 
				
			|||||||
        file_name = 'chatGPT对话历史' + time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime()) + '.html'
 | 
					        file_name = 'chatGPT对话历史' + time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime()) + '.html'
 | 
				
			||||||
    os.makedirs('./gpt_log/', exist_ok=True)
 | 
					    os.makedirs('./gpt_log/', exist_ok=True)
 | 
				
			||||||
    with open(f'./gpt_log/{file_name}', 'w', encoding='utf8') as f:
 | 
					    with open(f'./gpt_log/{file_name}', 'w', encoding='utf8') as f:
 | 
				
			||||||
        from theme.theme import advanced_css
 | 
					        from themes.theme import advanced_css
 | 
				
			||||||
        f.write(f'<!DOCTYPE html><head><meta charset="utf-8"><title>对话历史</title><style>{advanced_css}</style></head>')
 | 
					        f.write(f'<!DOCTYPE html><head><meta charset="utf-8"><title>对话历史</title><style>{advanced_css}</style></head>')
 | 
				
			||||||
        for i, contents in enumerate(chatbot):
 | 
					        for i, contents in enumerate(chatbot):
 | 
				
			||||||
            for j, content in enumerate(contents):
 | 
					            for j, content in enumerate(contents):
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								main.py
									
									
									
									
									
								
							@ -14,7 +14,7 @@ def main():
 | 
				
			|||||||
    if not AUTHENTICATION: AUTHENTICATION = None
 | 
					    if not AUTHENTICATION: AUTHENTICATION = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    from check_proxy import get_current_version
 | 
					    from check_proxy import get_current_version
 | 
				
			||||||
    from theme.theme import adjust_theme, advanced_css, theme_declaration
 | 
					    from themes.theme import adjust_theme, advanced_css, theme_declaration
 | 
				
			||||||
    initial_prompt = "Serve me as a writing and programming assistant."
 | 
					    initial_prompt = "Serve me as a writing and programming assistant."
 | 
				
			||||||
    title_html = f"<h1 align=\"center\">GPT 学术优化 {get_current_version()}</h1>{theme_declaration}"
 | 
					    title_html = f"<h1 align=\"center\">GPT 学术优化 {get_current_version()}</h1>{theme_declaration}"
 | 
				
			||||||
    description =  """代码开源和更新[地址🚀](https://github.com/binary-husky/chatgpt_academic),感谢热情的[开发者们❤️](https://github.com/binary-husky/chatgpt_academic/graphs/contributors)"""
 | 
					    description =  """代码开源和更新[地址🚀](https://github.com/binary-husky/chatgpt_academic),感谢热情的[开发者们❤️](https://github.com/binary-husky/chatgpt_academic/graphs/contributors)"""
 | 
				
			||||||
 | 
				
			|||||||
@ -60,7 +60,7 @@ def adjust_theme():
 | 
				
			|||||||
        if LAYOUT=="TOP-DOWN": 
 | 
					        if LAYOUT=="TOP-DOWN": 
 | 
				
			||||||
            js = ""
 | 
					            js = ""
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            with open('theme/common.js', 'r', encoding='utf8') as f: 
 | 
					            with open('themes/common.js', 'r', encoding='utf8') as f: 
 | 
				
			||||||
                js = f"<script>{f.read()}</script>"
 | 
					                js = f"<script>{f.read()}</script>"
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
        # 添加一个萌萌的看板娘
 | 
					        # 添加一个萌萌的看板娘
 | 
				
			||||||
@ -82,5 +82,5 @@ def adjust_theme():
 | 
				
			|||||||
        print('gradio版本较旧, 不能自定义字体和颜色')
 | 
					        print('gradio版本较旧, 不能自定义字体和颜色')
 | 
				
			||||||
    return set_theme
 | 
					    return set_theme
 | 
				
			||||||
 | 
					
 | 
				
			||||||
with open("theme/default.css", "r", encoding="utf-8") as f:
 | 
					with open("themes/default.css", "r", encoding="utf-8") as f:
 | 
				
			||||||
    advanced_css = f.read()
 | 
					    advanced_css = f.read()
 | 
				
			||||||
@ -77,7 +77,7 @@ def adjust_theme():
 | 
				
			|||||||
        if LAYOUT=="TOP-DOWN":
 | 
					        if LAYOUT=="TOP-DOWN":
 | 
				
			||||||
            js = ""
 | 
					            js = ""
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            with open('theme/common.js', 'r', encoding='utf8') as f:
 | 
					            with open('themes/common.js', 'r', encoding='utf8') as f:
 | 
				
			||||||
                js = f"<script>{f.read()}</script>"
 | 
					                js = f"<script>{f.read()}</script>"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # 添加一个萌萌的看板娘
 | 
					        # 添加一个萌萌的看板娘
 | 
				
			||||||
@ -100,5 +100,5 @@ def adjust_theme():
 | 
				
			|||||||
    return set_theme
 | 
					    return set_theme
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
with open("theme/green.css", "r", encoding="utf-8") as f:
 | 
					with open("themes/green.css", "r", encoding="utf-8") as f:
 | 
				
			||||||
    advanced_css = f.read()
 | 
					    advanced_css = f.read()
 | 
				
			||||||
							
								
								
									
										2
									
								
								version
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								version
									
									
									
									
									
								
							@ -1,5 +1,5 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "version": 3.46,
 | 
					  "version": 3.46,
 | 
				
			||||||
  "show_feature": true,
 | 
					  "show_feature": true,
 | 
				
			||||||
  "new_feature": "新增实时语音对话插件(自动断句,脱手对话) <-> 支持加载自定义的ChatGLM2微调模型 <-> 动态ChatBot窗口高度 <-> 修复Azure接口的BUG <-> 完善多语言模块 <-> 完善本地Latex矫错和翻译功能 <-> 增加gpt-3.5-16k的支持 <-> 新增最强Arxiv论文翻译插件 <-> 修复gradio复制按钮BUG <-> 修复PDF翻译的BUG, 新增HTML中英双栏对照 <-> 添加了OpenAI图片生成插件"
 | 
					  "new_feature": "临时修复theme的文件丢失问题 <-> 新增实时语音对话插件(自动断句,脱手对话) <-> 支持加载自定义的ChatGLM2微调模型 <-> 动态ChatBot窗口高度 <-> 修复Azure接口的BUG <-> 完善多语言模块 <-> 完善本地Latex矫错和翻译功能 <-> 增加gpt-3.5-16k的支持 <-> 新增最强Arxiv论文翻译插件 <-> 修复gradio复制按钮BUG <-> 修复PDF翻译的BUG, 新增HTML中英双栏对照 <-> 添加了OpenAI图片生成插件"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user