-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
26 lines (21 loc) · 798 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import gradio as gr
from rag import RAG
from dspy.utils import download
# "Example question: How many are working duplicate tasks? Who are they? What are these ta How can they optimize this"
# download("https://huggingface.co/dspy/cache/resolve/main/ragqa_arena_tech_corpus.jsonl")
# Gradio interface
def main():
rag = RAG()
interface = gr.Interface(
fn=rag,
inputs=gr.Textbox(label="Enter your question", placeholder="Type your question here..."),
outputs=[
gr.Textbox(label="Reasoning"),
gr.Textbox(label="Response")
],
title="RAG Question Answering",
description="Ask a question, and the RAG module will provide an answer based on the corpus."
)
interface.launch()
if __name__ == "__main__":
main()