add baidu stats
This commit is contained in:
5
main.py
5
main.py
@ -52,7 +52,12 @@ def main():
|
|||||||
CHATBOT_HEIGHT /= 2
|
CHATBOT_HEIGHT /= 2
|
||||||
|
|
||||||
cancel_handles = []
|
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:
|
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)
|
gr.HTML(title_html)
|
||||||
cookies = gr.State({'api_key': API_KEY, 'llm_model': LLM_MODEL})
|
cookies = gr.State({'api_key': API_KEY, 'llm_model': LLM_MODEL})
|
||||||
with gr_L1():
|
with gr_L1():
|
||||||
|
|||||||
10
sites/baidu_stats.html
Normal file
10
sites/baidu_stats.html
Normal 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>
|
||||||
Reference in New Issue
Block a user