Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,6 @@ def load_model():
|
|
| 26 |
def respond(message, history):
|
| 27 |
load_model()
|
| 28 |
|
| 29 |
-
# Ghép lịch sử chat
|
| 30 |
prompt = ""
|
| 31 |
for user, bot in history:
|
| 32 |
prompt += f"User: {user}\nAssistant: {bot}\n"
|
|
@@ -43,12 +42,10 @@ def respond(message, history):
|
|
| 43 |
|
| 44 |
text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 45 |
reply = text.split("Assistant:")[-1].strip()
|
| 46 |
-
|
| 47 |
return reply
|
| 48 |
|
| 49 |
gr.ChatInterface(
|
| 50 |
fn=respond,
|
| 51 |
title="🤖 Gemma3 270M Cloud Chat",
|
| 52 |
-
description="Gemma3 270M chạy cloud miễn phí trên Hugging Face Spaces"
|
| 53 |
-
theme="dark"
|
| 54 |
).launch(server_name="0.0.0.0")
|
|
|
|
| 26 |
def respond(message, history):
|
| 27 |
load_model()
|
| 28 |
|
|
|
|
| 29 |
prompt = ""
|
| 30 |
for user, bot in history:
|
| 31 |
prompt += f"User: {user}\nAssistant: {bot}\n"
|
|
|
|
| 42 |
|
| 43 |
text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 44 |
reply = text.split("Assistant:")[-1].strip()
|
|
|
|
| 45 |
return reply
|
| 46 |
|
| 47 |
gr.ChatInterface(
|
| 48 |
fn=respond,
|
| 49 |
title="🤖 Gemma3 270M Cloud Chat",
|
| 50 |
+
description="Gemma3 270M chạy cloud miễn phí trên Hugging Face Spaces"
|
|
|
|
| 51 |
).launch(server_name="0.0.0.0")
|