Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
import torch
|
| 3 |
from threading import Thread
|
| 4 |
from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer
|
|
@@ -12,7 +13,6 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 12 |
tie_word_embeddings=False # 尝试强制关闭权重绑定检查
|
| 13 |
)
|
| 14 |
|
| 15 |
-
import spaces
|
| 16 |
@spaces.GPU
|
| 17 |
def respond(message, history):
|
| 18 |
messages = [{"role": "system", "content": "You are Spartacus, a helpful assistant."}]
|
|
|
|
| 1 |
+
|
| 2 |
+
import spaces
|
| 3 |
import torch
|
| 4 |
from threading import Thread
|
| 5 |
from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer
|
|
|
|
| 13 |
tie_word_embeddings=False # 尝试强制关闭权重绑定检查
|
| 14 |
)
|
| 15 |
|
|
|
|
| 16 |
@spaces.GPU
|
| 17 |
def respond(message, history):
|
| 18 |
messages = [{"role": "system", "content": "You are Spartacus, a helpful assistant."}]
|