Spaces:
Build error
Build error
Renegadesoffun
commited on
Commit
Β·
2dbaebb
1
Parent(s):
f59161c
Updated for CPU usage2
Browse files
app.py
CHANGED
@@ -8,8 +8,7 @@ model_name = "microsoft/DialoGPT-small"
|
|
8 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
9 |
|
10 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
11 |
-
chat_pipeline = pipeline("text-generation", model=model, tokenizer=tokenizer, device=-1,
|
12 |
-
|
13 |
|
14 |
# Streamlit UI
|
15 |
st.title("Buddy Christ Chatbot π")
|
@@ -20,16 +19,9 @@ if user_input:
|
|
20 |
buddy_christ_prefix = """
|
21 |
Buddy Christ: A beacon of light in a world seeking clarity. Drawing inspiration from 'Conversations with God', he often chuckles and says, "Remember, life begins at the end of your comfort zone." With wisdom from Oakbridge, he playfully reminds us, "You are the love you seek." Infusing humor with profound insights from NTI, he jests, "Why take life so seriously when it's all just a divine play?" Dive deep into universal truths with Buddy Christ, and find joy, laughter, and enlightenment at every turn.
|
22 |
"""
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
Oakbridge University: He resonates with the teachings of Jeshua ben Joseph (Jesus) from oakbridgeuniversity.org, emphasizing the power of love, peace, and joy as our true nature.
|
30 |
-
Jeshua.net: Buddy Christ often shares insights about the transformative power of love and how embracing our divine nature can lead to profound inner peace, as taught on jeshua.net.
|
31 |
-
A Course of Love: He believes in the idea that "The heart should lead the mind in a dance of union and communion," emphasizing the importance of leading with love and compassion in all our interactions.
|
32 |
-
A Course in Miracles: Buddy Christ often light-heartedly mentions that "Miracles are natural. When they do not occur, something has gone wrong," encouraging everyone to see the miraculous in everyday life.
|
33 |
-
The Holy Spirit's Interpretation of the New Testament by Regina dawn Akers: When interpreting Bible verses, Buddy Christ draws from this source, emphasizing the oneness of all and the importance of letting go of the ego. For instance, when discussing the verse "I AM the Way, the Truth, and the Life," he might say, "In the eyes of the Holy Spirit, this means we all embody the 'I AM' presence, and it's about recognizing the divine within each one of us."
|
34 |
-
""")
|
35 |
-
|
|
|
8 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
9 |
|
10 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
11 |
+
chat_pipeline = pipeline("text-generation", model=model, tokenizer=tokenizer, device=-1, max_length=1000)
|
|
|
12 |
|
13 |
# Streamlit UI
|
14 |
st.title("Buddy Christ Chatbot π")
|
|
|
19 |
buddy_christ_prefix = """
|
20 |
Buddy Christ: A beacon of light in a world seeking clarity. Drawing inspiration from 'Conversations with God', he often chuckles and says, "Remember, life begins at the end of your comfort zone." With wisdom from Oakbridge, he playfully reminds us, "You are the love you seek." Infusing humor with profound insights from NTI, he jests, "Why take life so seriously when it's all just a divine play?" Dive deep into universal truths with Buddy Christ, and find joy, laughter, and enlightenment at every turn.
|
21 |
"""
|
22 |
+
# Tokenize the input with truncation
|
23 |
+
inputs = tokenizer(buddy_christ_prefix + user_input, return_tensors="pt", truncation=True, max_length=1000)
|
24 |
+
# Generate the response
|
25 |
+
response = model.generate(**inputs)
|
26 |
+
response_text = tokenizer.decode(response[0], skip_special_tokens=True)
|
27 |
+
st.write("Buddy Christ:", response_text[len(buddy_christ_prefix):])
|
|
|
|
|
|
|
|
|
|
|
|
|
|