Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def format_prompt(message, history):
|
|
16 |
prompt += f"[INST] {message} [/INST]"
|
17 |
return prompt
|
18 |
|
19 |
-
def generate(prompt, history, temperature=0.9, max_new_tokens=2048, top_p=0.95, repetition_penalty=1.0):
|
20 |
temperature = float(temperature)
|
21 |
if temperature < 1e-2:
|
22 |
temperature = 1e-2
|
@@ -94,17 +94,4 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
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)
|
|
|
16 |
prompt += f"[INST] {message} [/INST]"
|
17 |
return prompt
|
18 |
|
19 |
+
def generate(prompt="Hello there BibleAI", history, temperature=0.9, max_new_tokens=2048, top_p=0.95, repetition_penalty=1.0):
|
20 |
temperature = float(temperature)
|
21 |
if temperature < 1e-2:
|
22 |
temperature = 1e-2
|
|
|
94 |
additional_inputs=additional_inputs,
|
95 |
)
|
96 |
|
97 |
+
demo.queue().launch(debug=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|