Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,8 +26,8 @@ tokenizer = None
|
|
| 26 |
def initialize_ai_model():
|
| 27 |
global model, tokenizer
|
| 28 |
try:
|
| 29 |
-
print("🤖 Loading
|
| 30 |
-
model_id = "
|
| 31 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 32 |
model = AutoModelForCausalLM.from_pretrained(
|
| 33 |
model_id,
|
|
@@ -62,7 +62,7 @@ def store_full_introduction(message_content, author_name):
|
|
| 62 |
}
|
| 63 |
|
| 64 |
async def generate_ai_welcome_message(new_members, recent_context):
|
| 65 |
-
"""Generate a personalized welcome message using
|
| 66 |
if not model or not tokenizer:
|
| 67 |
return None
|
| 68 |
|
|
@@ -268,6 +268,6 @@ demo = gr.Interface(
|
|
| 268 |
inputs="text",
|
| 269 |
outputs="text",
|
| 270 |
title="🤖 AI-Powered Discord Welcome Bot",
|
| 271 |
-
description="Enhanced with
|
| 272 |
)
|
| 273 |
-
demo.launch()
|
|
|
|
| 26 |
def initialize_ai_model():
|
| 27 |
global model, tokenizer
|
| 28 |
try:
|
| 29 |
+
print("🤖 Loading SmolLM2 AI model for personalized welcomes...")
|
| 30 |
+
model_id = "HuggingFaceTB/SmolLM2-360M-Instruct"
|
| 31 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 32 |
model = AutoModelForCausalLM.from_pretrained(
|
| 33 |
model_id,
|
|
|
|
| 62 |
}
|
| 63 |
|
| 64 |
async def generate_ai_welcome_message(new_members, recent_context):
|
| 65 |
+
"""Generate a personalized welcome message using SmolLM2 AI with full introduction context"""
|
| 66 |
if not model or not tokenizer:
|
| 67 |
return None
|
| 68 |
|
|
|
|
| 268 |
inputs="text",
|
| 269 |
outputs="text",
|
| 270 |
title="🤖 AI-Powered Discord Welcome Bot",
|
| 271 |
+
description="Enhanced with SmolLM2-360M-Instruct for personalized community welcomes!"
|
| 272 |
)
|
| 273 |
+
demo.launch()
|