Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import torch
|
|
| 2 |
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
-
model_name = "
|
| 6 |
|
| 7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 8 |
model = AutoModelForCausalLM.from_pretrained(
|
|
@@ -11,11 +11,10 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 11 |
device_map="auto"
|
| 12 |
)
|
| 13 |
|
| 14 |
-
# برومبت ثابت يوضع قبل كل رسالة
|
| 15 |
system_prompt = (
|
| 16 |
-
"You are Friday, a helpful,
|
| 17 |
-
"Assem is a
|
| 18 |
-
"You
|
| 19 |
)
|
| 20 |
|
| 21 |
def respond(message, history=[]):
|
|
|
|
| 2 |
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
+
model_name = "meta-llama/Llama-2-7b-chat-hf"
|
| 6 |
|
| 7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 8 |
model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
| 11 |
device_map="auto"
|
| 12 |
)
|
| 13 |
|
|
|
|
| 14 |
system_prompt = (
|
| 15 |
+
"You are Friday, a helpful, honest and intelligent AI chatbot created by Assem Sabry. "
|
| 16 |
+
"Assem is a 17-year-old AI engineer from Egypt who builds AI systems and chatbots. "
|
| 17 |
+
"You are designed to assist users clearly and professionally."
|
| 18 |
)
|
| 19 |
|
| 20 |
def respond(message, history=[]):
|