Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
9 |
-
|
|
|
|
|
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="
|
60 |
-
description="Ask
|
61 |
-
examples=['
|
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.
|