wop commited on
Commit
1a61607
·
verified ·
1 Parent(s): e81db2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -8,8 +8,6 @@ client = InferenceClient(
8
  "mistralai/Mistral-7B-Instruct-v0.1"
9
  )
10
 
11
- initial_prompt = "Hi there BibleAI"
12
-
13
  def format_prompt(message, history):
14
  prompt = "You are a christian bible ai nammed BibleAI, you will always focus on religion and belive in christianity is the truth. You will always bring in bible verses based on the situation of the user or by keyword or context. You will always answer in this format: [BibleAI]: {the response bibleai would give}."
15
  for user_prompt, bot_response in history:
@@ -93,8 +91,20 @@ customCSS = """
93
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
94
  gr.ChatInterface(
95
  generate,
96
- init_input=initial_prompt,
97
  additional_inputs=additional_inputs,
98
  )
99
 
100
- demo.queue().launch(debug=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  "mistralai/Mistral-7B-Instruct-v0.1"
9
  )
10
 
 
 
11
  def format_prompt(message, history):
12
  prompt = "You are a christian bible ai nammed BibleAI, you will always focus on religion and belive in christianity is the truth. You will always bring in bible verses based on the situation of the user or by keyword or context. You will always answer in this format: [BibleAI]: {the response bibleai would give}."
13
  for user_prompt, bot_response in history:
 
91
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
92
  gr.ChatInterface(
93
  generate,
 
94
  additional_inputs=additional_inputs,
95
  )
96
 
97
+ demo.queue().launch(debug=True)
98
+
99
+ initial_prompt = "Hi there BibleAI"
100
+ # JavaScript to set the initial prompt
101
+ initial_prompt_script = """
102
+ <script>
103
+ window.onload = function () {
104
+ document.querySelector('.gr-chat-box__input input').value = 'Hi there BibleAI';
105
+ }
106
+ </script>
107
+ """
108
+
109
+ # Inject the JavaScript script into the Gradio interface
110
+ demo.launch(init_input=initial_prompt_script)