Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,7 +39,7 @@ body::before {
|
|
| 39 |
|
| 40 |
geomodel_llm = keras_nlp.models.CausalLM.from_preset("hf://ShebMichel/geobot_teacher-v0")
|
| 41 |
|
| 42 |
-
def
|
| 43 |
template = "Instruction:\n{instruction}\n\nResponse:\n{response}"
|
| 44 |
prompt = template.format(
|
| 45 |
instruction=input,
|
|
@@ -187,15 +187,6 @@ with gr.Blocks() as iface:
|
|
| 187 |
interactive=False
|
| 188 |
)
|
| 189 |
# ### Mode; response here:
|
| 190 |
-
# Question_prompt="How do sedimentary rocks form?"
|
| 191 |
-
# template = "Question:\n{Question}\n\nResponse:\n{Response}"
|
| 192 |
-
# prompt = template.format(
|
| 193 |
-
# Question=Question_prompt,
|
| 194 |
-
# Response="",
|
| 195 |
-
# )
|
| 196 |
-
# sampler = keras_nlp.samplers.TopKSampler(k=2, seed=1)
|
| 197 |
-
# geomodel_llm.compile(sampler=sampler)
|
| 198 |
-
# print(gemma_lm.generate(prompt, max_length=256))
|
| 199 |
|
| 200 |
# Submit button - Passes selected question to the model
|
| 201 |
with gr.Row():
|
|
@@ -206,13 +197,13 @@ with gr.Blocks() as iface:
|
|
| 206 |
radio_section.change(
|
| 207 |
fn=set_question_to_edit,
|
| 208 |
inputs=[radio_section],
|
| 209 |
-
outputs=
|
| 210 |
)
|
| 211 |
|
| 212 |
submit_button.click(
|
| 213 |
-
fn=submit_question,
|
| 214 |
inputs=[question_edit],
|
| 215 |
-
outputs=[model_response]
|
| 216 |
)
|
| 217 |
|
| 218 |
clear_button.click(
|
|
|
|
| 39 |
|
| 40 |
geomodel_llm = keras_nlp.models.CausalLM.from_preset("hf://ShebMichel/geobot_teacher-v0")
|
| 41 |
|
| 42 |
+
def model_launch(input):
|
| 43 |
template = "Instruction:\n{instruction}\n\nResponse:\n{response}"
|
| 44 |
prompt = template.format(
|
| 45 |
instruction=input,
|
|
|
|
| 187 |
interactive=False
|
| 188 |
)
|
| 189 |
# ### Mode; response here:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
|
| 191 |
# Submit button - Passes selected question to the model
|
| 192 |
with gr.Row():
|
|
|
|
| 197 |
radio_section.change(
|
| 198 |
fn=set_question_to_edit,
|
| 199 |
inputs=[radio_section],
|
| 200 |
+
outputs=[question_edit]
|
| 201 |
)
|
| 202 |
|
| 203 |
submit_button.click(
|
| 204 |
+
fn=model_launch,#submit_question, ## model_launch
|
| 205 |
inputs=[question_edit],
|
| 206 |
+
outputs=[model_response]
|
| 207 |
)
|
| 208 |
|
| 209 |
clear_button.click(
|