Heng666 commited on
Commit
51348be
·
verified ·
1 Parent(s): 1b3b9d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -5,8 +5,10 @@ from transformers import StoppingCriteria, StoppingCriteriaList, TextIteratorStr
5
  from threading import Thread
6
 
7
  # Loading the tokenizer and model from Hugging Face's model hub.
8
- tokenizer = AutoTokenizer.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0")
9
- model = AutoModelForCausalLM.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0")
 
 
10
 
11
  # using CUDA for an optimal experience
12
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
@@ -56,7 +58,7 @@ def predict(message, history):
56
 
57
  # Setting up the Gradio chat interface.
58
  gr.ChatInterface(predict,
59
- title="Tinyllama_chatBot",
60
- description="Ask Tiny llama any questions",
61
- examples=['How to cook a fish?', 'Who is the president of US now?']
62
  ).launch() # Launching the web interface.
 
5
  from threading import Thread
6
 
7
  # Loading the tokenizer and model from Hugging Face's model hub.
8
+ # model_name = "TinyLlama/TinyLlama-1.1B-Chat-v1.0"
9
+ model_name = "scutcyr/BianQue-2"
10
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
11
+ model = AutoModelForCausalLM.from_pretrained(model_name)
12
 
13
  # using CUDA for an optimal experience
14
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
 
58
 
59
  # Setting up the Gradio chat interface.
60
  gr.ChatInterface(predict,
61
+ title="TCM_ChatBLM_chatBot",
62
+ description="Ask TCM_ChatBLM_chatBot any questions",
63
+ examples=['你好,我最近失眠,可以怎麼解決?', '請問有沒有跌打藥可以用?']
64
  ).launch() # Launching the web interface.