Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -289,7 +289,7 @@ def transfer_input(inputs):
|
|
| 289 |
##############################################
|
| 290 |
# generate function
|
| 291 |
##############################################
|
| 292 |
-
def generate(
|
| 293 |
#mit RAG
|
| 294 |
if (rag_option is None):
|
| 295 |
raise gr.Error("Retrieval Augmented Generation ist erforderlich.")
|
|
@@ -465,17 +465,17 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
| 465 |
predict_args = dict(
|
| 466 |
fn=generate,
|
| 467 |
inputs=[
|
| 468 |
-
chatbot,
|
| 469 |
user_input,
|
|
|
|
| 470 |
#history,
|
| 471 |
-
rag_option,
|
| 472 |
-
model_option,
|
| 473 |
-
anzahl_docs,
|
| 474 |
-
top_p,
|
| 475 |
-
temperature,
|
| 476 |
-
max_length_tokens,
|
| 477 |
-
max_context_length_tokens,
|
| 478 |
-
repetition_penalty
|
| 479 |
],
|
| 480 |
outputs=[ chatbot, status_display], #[ chatbot, history, status_display],
|
| 481 |
show_progress=True,
|
|
|
|
| 289 |
##############################################
|
| 290 |
# generate function
|
| 291 |
##############################################
|
| 292 |
+
def generate(text, history, rag_option, model_option, k=3, top_p=0.6, temperature=0.5, max_new_tokens=4048, max_context_length_tokens=2048, repetition_penalty=1.3,):
|
| 293 |
#mit RAG
|
| 294 |
if (rag_option is None):
|
| 295 |
raise gr.Error("Retrieval Augmented Generation ist erforderlich.")
|
|
|
|
| 465 |
predict_args = dict(
|
| 466 |
fn=generate,
|
| 467 |
inputs=[
|
|
|
|
| 468 |
user_input,
|
| 469 |
+
chatbot,
|
| 470 |
#history,
|
| 471 |
+
#rag_option,
|
| 472 |
+
#model_option,
|
| 473 |
+
#anzahl_docs,
|
| 474 |
+
#top_p,
|
| 475 |
+
#temperature,
|
| 476 |
+
#max_length_tokens,
|
| 477 |
+
#max_context_length_tokens,
|
| 478 |
+
#repetition_penalty
|
| 479 |
],
|
| 480 |
outputs=[ chatbot, status_display], #[ chatbot, history, status_display],
|
| 481 |
show_progress=True,
|