Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,21 @@
|
|
1 |
-
|
2 |
import gradio as gr
|
3 |
-
from
|
4 |
|
5 |
def answer_question(query):
|
6 |
-
|
|
|
|
|
|
|
|
|
7 |
|
8 |
iface = gr.Interface(
|
9 |
fn=answer_question,
|
10 |
-
inputs=gr.Textbox(label="Stelle
|
11 |
outputs="text",
|
12 |
-
title="Catan Regel-Experte",
|
13 |
-
description="
|
|
|
14 |
)
|
15 |
|
16 |
-
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from rag_pipeline import run_qa_pipeline
|
3 |
|
4 |
def answer_question(query):
|
5 |
+
try:
|
6 |
+
answer = run_qa_pipeline(query)
|
7 |
+
return answer
|
8 |
+
except Exception as e:
|
9 |
+
return f"Fehler: {str(e)}"
|
10 |
|
11 |
iface = gr.Interface(
|
12 |
fn=answer_question,
|
13 |
+
inputs=gr.Textbox(label="Stelle deine Frage zu Catan", placeholder="z.B. Welche Zahl ist am besten?"),
|
14 |
outputs="text",
|
15 |
+
title="🧠 Catan Regel-Experte (RAG)",
|
16 |
+
description="Frage etwas zu den Catan-Regeln. Die App durchsucht echte PDF-Regeln und gibt eine Antwort basierend auf dem Dokumentinhalt.",
|
17 |
+
allow_flagging="never"
|
18 |
)
|
19 |
|
20 |
+
if __name__ == "__main__":
|
21 |
+
iface.launch()
|