Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ from transformers import (
|
|
| 6 |
TextIteratorStreamer,
|
| 7 |
)
|
| 8 |
import gradio as gr
|
|
|
|
| 9 |
|
| 10 |
# Load model and tokenizer
|
| 11 |
model_id = "microsoft/bitnet-b1.58-2B-4T"
|
|
@@ -17,6 +18,7 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 17 |
device_map="auto"
|
| 18 |
)
|
| 19 |
|
|
|
|
| 20 |
def respond(
|
| 21 |
message: str,
|
| 22 |
history: list[tuple[str, str]],
|
|
|
|
| 6 |
TextIteratorStreamer,
|
| 7 |
)
|
| 8 |
import gradio as gr
|
| 9 |
+
import spaces
|
| 10 |
|
| 11 |
# Load model and tokenizer
|
| 12 |
model_id = "microsoft/bitnet-b1.58-2B-4T"
|
|
|
|
| 18 |
device_map="auto"
|
| 19 |
)
|
| 20 |
|
| 21 |
+
@spaces.GPU
|
| 22 |
def respond(
|
| 23 |
message: str,
|
| 24 |
history: list[tuple[str, str]],
|