Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -26,6 +26,7 @@ tokenizer = None
|
|
26 |
model = None
|
27 |
|
28 |
# --- Load Models and Tokenizers Function ---
|
|
|
29 |
def load_model_and_tokenizer():
|
30 |
"""
|
31 |
Loads the language model and tokenizer from Hugging Face Hub or a local path.
|
@@ -61,6 +62,7 @@ def load_model_and_tokenizer():
|
|
61 |
|
62 |
|
63 |
# --- Generate Response Function ---
|
|
|
64 |
def generate_response(
|
65 |
message: str, # Current user message
|
66 |
history: list # Gradio Chatbot history format (list of dictionaries with 'role' and 'content')
|
|
|
26 |
model = None
|
27 |
|
28 |
# --- Load Models and Tokenizers Function ---
|
29 |
+
@spaces.GPU
|
30 |
def load_model_and_tokenizer():
|
31 |
"""
|
32 |
Loads the language model and tokenizer from Hugging Face Hub or a local path.
|
|
|
62 |
|
63 |
|
64 |
# --- Generate Response Function ---
|
65 |
+
@spaces.GPU
|
66 |
def generate_response(
|
67 |
message: str, # Current user message
|
68 |
history: list # Gradio Chatbot history format (list of dictionaries with 'role' and 'content')
|