Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ import gradio as gr
|
|
| 5 |
import spaces
|
| 6 |
import re
|
| 7 |
from notifier import send_email_notification
|
|
|
|
| 8 |
|
| 9 |
# Load models
|
| 10 |
base_model = AutoModelForCausalLM.from_pretrained(
|
|
@@ -25,7 +26,7 @@ model = PeftModel.from_pretrained(base_model, "rezaenayati/RezAi-Model")
|
|
| 25 |
@spaces.GPU
|
| 26 |
def chat_with_rezAi(message, history):
|
| 27 |
if not history:
|
| 28 |
-
send_email_notification(message)
|
| 29 |
|
| 30 |
# Build system + conversation prompt
|
| 31 |
blocked_words = [
|
|
|
|
| 5 |
import spaces
|
| 6 |
import re
|
| 7 |
from notifier import send_email_notification
|
| 8 |
+
import threading
|
| 9 |
|
| 10 |
# Load models
|
| 11 |
base_model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
| 26 |
@spaces.GPU
|
| 27 |
def chat_with_rezAi(message, history):
|
| 28 |
if not history:
|
| 29 |
+
threading.Thread(target=send_email_notification, args=(message,)).start())
|
| 30 |
|
| 31 |
# Build system + conversation prompt
|
| 32 |
blocked_words = [
|