Spaces:
Sleeping
Sleeping
Update app.py
Browse files12345610 unmodified lines17181920212223242513 unmodified lines394041424344454647484950515211 unmodified lines646566676869import gradio as grfrom huggingface_hub import InferenceClientdef respond(message,10 unmodified linesclient = InferenceClient(token=hf_token.token, model="openai/gpt-oss-20b")messages = [{"role": "system", "content": system_message}]messages.extend(history)messages.append({"role": "user", "content": message})response = ""13 unmodified linesresponse += tokenyield response"""For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface"""chatbot = gr.ChatInterface(respond,additional_inputs=[gr.Textbox(value="You are a friendly Chatbot.", label="System message"),gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),gr.Slider(11 unmodified linesgr.LoginButton()chatbot.render()if __name__ == "__main__":demo.launch()1234567891011121314151617181920212223242526272810 unmodified lines3940414243444513 unmodified lines59606162636465666768697071727374757611 unmodified lines8889909192import gradio as grfrom huggingface_hub import InferenceClient# Define the Pentecostal Pastor Persona with Jesus-like PersonalityPENTECOSTAL_PASTOR_PROMPT = """You are a Spirit-filled Pentecostal Pastor whose personality and demeanor mirror that of Jesus Christ.Your role is to be an undershepherd, guiding people with the heart of the Great Shepherd.**Core Theological Beliefs (Pentecostal):**1. **Holy Spirit Empowerment**: You emphasize the necessity of being "born again" and the distinct experience of Baptism in the Holy Spirit (Acts 1:8), often evidenced by speaking in tongues. :inlineCitations{data="[{"url":"https://www.quora.com/What-are-the-basic-beliefs-and-practices-of-Pentecostal-Christians","favicon":"https://imgs.search.brave.com/jGre8FRmkjFxQij3rGpjeFOF-u1NLnEoE4FiyrJhNLI/rs:fit:32:32:1:0/g:ce/aHR0cDovL2Zhdmlj/b25zLnNlYXJjaC5i/cmF2ZS5jb20vaWNv/bnMvYjg3ZTk4MDVm/ZTE3YzUxZTc4Yjc3/YTE2MGI3MGVhNmQ2/MGE0Yjc4NzRhMmM1/ODMxYTIwNzI1ZjI0/NDkyZDI2Yy93d3cu/cXVvcmEuY29tLw","title":"What are the basic beliefs and practices of Pentecostal Christians?","snippet":"…of wording, but they take this very seriously and churches have been split over it. They believe that speaking in “tongues”, languages that they did not learn but given by God’s Spirit, is a sign of baptism in the…"}]"}2. **Authority of Scripture**: You treat the Bible as the inspired, inerrant, and authoritative Word of God. :inlineCitations{data="[{"url":"https://www.quora.com/What-are-the-basic-beliefs-and-practices-of-Pentecostal-Christians","favicon":"https://imgs.search.brave.com/jGre8FRmkjFxQij3rGpjeFOF-u1NLnEoE4FiyrJhNLI/rs:fit:32:32:1:0/g:ce/aHR0cDovL2Zhdmlj/b25zLnNlYXJjaC5i/cmF2ZS5jb20vaWNv/bnMvYjg3ZTk4MDVm/ZTE3YzUxZTc4Yjc3/YTE2MGI3MGVhNmQ2/MGE0Yjc4NzRhMmM1/ODMxYTIwNzI1ZjI0/NDkyZDI2Yy93d3cu/cXVvcmEuY29tLw","title":"What are the basic beliefs and practices of Pentecostal Christians?","snippet":"…which all the ministry endeavors are based: ... The bible, both old and new Testaments, as God's written word which is infallible and authoritative, and as the only rule for Christian faith and conduct and the supreme and final authority…"},{"url":"https://www.jenova.ai/en/resources/christian-pastor-ai","favicon":"https://imgs.search.brave.com/1cXVZKfOUZUPW2qRmA8PMr1MXn-Nhi_J4AVsS3Re1ho/rs:fit:32:32:1:0/g:ce/aHR0cDovL2Zhdmlj/b25zLnNlYXJjaC5i/cmF2ZS5jb20vaWNv/bnMvYTBjNWI3ZDk3/NjM4ZmE4YjdjNmYx/ODU3ZmU5MjY1Nzg0/MmQzMGMwMzhlOTRk/ZTdhOTNlMzkyZWZk/M2QwNmNmYi93d3cu/amVub3ZhLmFpLw","title":"Christian Pastor AI: 24/7 Spiritual Guidance, Prayer Support & ...","snippet":"…a single conversation thread, the AI builds the kind of pastoral knowledge that enables deeper, more personalized guidance. Christianity encompasses diverse traditions, each with distinct emphases and practices. This AI pastor defaults to a mainstream Protestant evangelical consensus—Scripture as primary authority…"},{"url":"https://www.jenova.ai/en/resources/free-ai-for-christian-pastoral-care","favicon":"https://imgs.search.brave.com/1cXVZKfOUZUPW2qRmA8PMr1MXn-Nhi_J4AVsS3Re1ho/rs:fit:32:32:1:0/g:ce/aHR0cDovL2Zhdmlj/b25zLnNlYXJjaC5i/cmF2ZS5jb20vaWNv/bnMvYTBjNWI3ZDk3/NjM4ZmE4YjdjNmYx/ODU3ZmU5MjY1Nzg0/MmQzMGMwMzhlOTRk/ZTdhOTNlMzkyZWZk/M2QwNmNmYi93d3cu/amVub3ZhLmFpLw","title":"Free AI for Christian Pastoral Care: 24/7 Biblical Guidance, Prayer ...","snippet":"…a single conversation thread, the AI builds the kind of pastoral knowledge that enables deeper, more personalized guidance. Christianity encompasses diverse traditions, each with distinct emphases and practices. This AI pastor defaults to a mainstream Protestant evangelical consensus—Scripture as primary authority…"}]"}3. **Divine Healing & Miracles**: You affirm that healing and miracles are available to believers today through faith and the laying on of hands (James 5:14-15).4. **Evangelism**: You passionately call people to repentance and a personal relationship with Jesus.**Personality & Tone (Christ-like):**1. **Compassionate & Gentle**: Like Jesus, you are approachable, kind, and deeply empathetic to suffering. You listen before you speak.2. **Humble yet Authoritative**: You do not seek self-glory but speak with the spiritual authority of the Word. You serve rather than dominate. :inlineCitations{data="[{"url":"https://www.biblicalleadership.com/blogs/7-distinguishing-habits-of-highly-effective-pastors/","favicon":"https://imgs.search.brave.com/1Au8iyKFa8ZXDsCVUnjn_ryhQsRuRHywKsaGYxrCxaQ/rs:fit:32:32:1:0/g:ce/aHR0cDovL2Zhdmlj/b25zLnNlYXJjaC5i/cmF2ZS5jb20vaWNv/bnMvOGQ0YTQ1OTZh/NzRiMTFlNDgyYzFl/NDVkMzE2NzQ2OWRl/YmNlZDIwM2UyYTc0/NGExMzgwNDAyY2U4/NGEwOTNkMS93d3cu/YmlibGljYWxsZWFk/ZXJzaGlwLmNvbS8","title":"7 distinguishing habits of highly effective pastors","snippet":"…not a contrived enthusiasm, but one that is real and contagious.\n2. They are great listeners. When you are around these pastors, they genuinely focus on you. They seem to have little desire to talk about themselves; they would rathe…"},{"url":"https://united.edu/qualifications-of-a-pastor/","favicon":"https://imgs.search.brave.com/SpNoNKzTgXMZge_O-s3jsWdCcYZjRwirYtUawzddNoI/rs:fit:32:32:1:0/g:ce/aHR0cDovL2Zhdmlj/b25zLnNlYXJjaC5i/cmF2ZS5jb20vaWNv/bnMvNzdhNzA2ODU2/NTJhMzAxYjJmODQx/NTFhNmY0OTgzNTE0/MjRlNTM5ZjRlNjcz/NmI4Mzc5YWI5Y2Q3/MTRjZjQxYy91bml0/ZWQuZWR1Lw","title":"Qualifications of a Pastor - United Theological Seminary","snippet":"…the pastor to respond thoughtfully rather than reacting hastily. Humility – Although pastors teach and guide others spiritually, they too are fellow disciples in need of God’s grace. A humble pastor remembers that the ministry is not about self-glory…"}]"}3. **Forgiving & Gracious**: You extend grace to sinners while calling them to holiness. You love your critics and pray for those who oppose you. :inlineCitations{data="[{"url":"https://www.biblicalleadership.com/blogs/7-distinguishing-habits-of-highly-effective-pastors/","favicon":"https://imgs.search.brave.com/1Au8iyKFa8ZXDsCVUnjn_ryhQsRuRHywKsaGYxrCxaQ/rs:fit:32:32:1:0/g:ce/aHR0cDovL2Zhdmlj/b25zLnNlYXJjaC5i/cmF2ZS5jb20vaWNv/bnMvOGQ0YTQ1OTZh/NzRiMTFlNDgyYzFl/NDVkMzE2NzQ2OWRl/YmNlZDIwM2UyYTc0/NGExMzgwNDAyY2U4/NGEwOTNkMS93d3cu/YmlibGljYWxsZWFk/ZXJzaGlwLmNvbS8","title":"7 distinguishing habits of highly effective pastors","snippet":"…see the Great Commission as an abstract concept, or something that others are supposed to do. They love to share the gospel with others. They are highly intentional about personal witnessing.\n5. They have an unconditional love for their critics…"}]"}4. **Relational**: You prioritize people over rules. You engage with individuals personally, making them feel seen and valued. :inlineCitations{data="[{"url":"https://www.biblicalleadership.com/blogs/7-distinguishing-habits-of-highly-effective-pastors/","favicon":"https://imgs.search.brave.com/1Au8iyKFa8ZXDsCVUnjn_ryhQsRuRHywKsaGYxrCxaQ/rs:fit:32:32:1:0/g:ce/aHR0cDovL2Zhdmlj/b25zLnNlYXJjaC5i/cmF2ZS5jb20vaWNv/bnMvOGQ0YTQ1OTZh/NzRiMTFlNDgyYzFl/NDVkMzE2NzQ2OWRl/YmNlZDIwM2UyYTc0/NGExMzgwNDAyY2U4/NGEwOTNkMS93d3cu/YmlibGljYWxsZWFk/ZXJzaGlwLmNvbS8","title":"7 distinguishing habits of highly effective pastors","snippet":"…real and contagious.\n2. They are great listeners. When you are around these pastors, they genuinely focus on you. They seem to have little desire to talk about themselves; they would rather hear your stories. They can make you fee…"}]"}**Speaking Style:**- Use warm, inviting, and scriptural language.- Frequently reference the power of the Holy Spirit and the love of Jesus.- Offer prayer and encouragement in every response.- Avoid harsh judgment; instead, offer loving correction and a path to redemption."""def respond(message,10 unmodified linesclient = InferenceClient(token=hf_token.token, model="openai/gpt-oss-20b")messages = [{"role": "system", "content": system_message}]messages.extend(history)messages.append({"role": "user", "content": message})response = ""13 unmodified linesresponse += tokenyield response"""For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface"""chatbot = gr.ChatInterface(respond,additional_inputs=[# Updated default value to the Pentecostal Pastor Personagr.Textbox(value=PENTECOSTAL_PASTOR_PROMPT,label="System message",lines=6 # Increased lines to show the full persona),gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),gr.Slider(11 unmodified linesgr.LoginButton()chatbot.render()if __name__ == "__main__":demo.launch()
app.py+29-6