add baidu stats

This commit is contained in:
Rongkang Xiong
2023-06-27 10:05:36 +08:00
parent 4bc073b072
commit 0aadeabccc
2 changed files with 15 additions and 0 deletions

View File

@ -52,7 +52,12 @@ def main():
CHATBOT_HEIGHT /= 2
cancel_handles = []
# Read your Baidu statistics code from the file
baidu_stats_code = Path('./sites/baidu_stats.html').read_text()
with gr.Blocks(title="ChatGPT 学术优化", theme=set_theme, analytics_enabled=False, css=advanced_css) as demo:
# Insert your Baidu statistics code here
gr.HTML(baidu_stats_code)
# Insert Title
gr.HTML(title_html)
cookies = gr.State({'api_key': API_KEY, 'llm_model': LLM_MODEL})
with gr_L1():

10
sites/baidu_stats.html Normal file
View File

@ -0,0 +1,10 @@
<!-- baidu_stats.html -->
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?208673d55832a94b9bbe10b1f4e70c09";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>