dahaoGPT commited on
Commit
7921913
·
1 Parent(s): 203fdf7

add gr variable

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,4 +1,5 @@
1
  from transformers import AutoModel, AutoTokenizer
 
2
  tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True)
3
  model = AutoModel.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True).half().cuda()
4
  model = model.eval()
@@ -11,7 +12,10 @@ def beginchat(input, history=None):
11
 
12
 
13
  with gr.Blocks() as chatglm2bot:
14
- gr.Markdown('''## ChatGLM2-6B - chatbot demo''')
 
 
 
15
  state = gr.State([])
16
  chatbot = gr.Chatbot([], elem_id="chatbot").style(height=400)
17
  with gr.Row():
 
1
  from transformers import AutoModel, AutoTokenizer
2
+ import gradio as gr
3
  tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True)
4
  model = AutoModel.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True).half().cuda()
5
  model = model.eval()
 
12
 
13
 
14
  with gr.Blocks() as chatglm2bot:
15
+ gr.Markdown('''## ChatGLM2-6B - chatbot demo
16
+ Glm-130b: An open bilingual pre-trained model
17
+ Author: Zeng, Aohan and Liu, Xiao and Du, Zhengxiao and Wang, Zihan and Lai, Hanyu and Ding, Ming and Yang, Zhuoyi and Xu, Yifan and Zheng, Wendi and Xia, Xiao and others
18
+ Paper: arXiv preprint arXiv:2210.02414''')
19
  state = gr.State([])
20
  chatbot = gr.Chatbot([], elem_id="chatbot").style(height=400)
21
  with gr.Row():