Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,9 +6,11 @@ model_name = "MajorJalud/Qwen2.5-0.5B-Instruct-Gensyn-Swarm-reptilian_strong_gul
|
|
| 6 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 7 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 8 |
|
|
|
|
| 9 |
# Function to handle the chat
|
| 10 |
def chat(message, history):
|
| 11 |
# Add a prompt to make the model act like a helpful assistant
|
|
|
|
| 12 |
prompt = f"You are a helpful assistant. User: {message} Assistant: "
|
| 13 |
inputs = tokenizer(prompt, return_tensors="pt")
|
| 14 |
# Generate a response
|
|
|
|
| 6 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 7 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 8 |
|
| 9 |
+
|
| 10 |
# Function to handle the chat
|
| 11 |
def chat(message, history):
|
| 12 |
# Add a prompt to make the model act like a helpful assistant
|
| 13 |
+
inputs = tokenizer("You are a helpful assistant. User: " + message, return_tensors="pt")
|
| 14 |
prompt = f"You are a helpful assistant. User: {message} Assistant: "
|
| 15 |
inputs = tokenizer(prompt, return_tensors="pt")
|
| 16 |
# Generate a response
|