Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from Study_RAG import answer_pipeline | |
| import os | |
| import gradio as gr | |
| HF_TOKEN = os.getenv('data_bridge_pass') | |
| hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "ZagreusMiura/test1_data") | |
| demo = gr.Interface( | |
| answer_pipeline, | |
| [ | |
| gr.Textbox( | |
| label="Submit Questions Related to Study Programs", | |
| info = "Questions can include program suggestions, requirements, scholarships, etc.", | |
| placeholder="Suggest a list of statistics programs in Amsterdam", | |
| ) | |
| ], | |
| [ | |
| gr.Textbox( | |
| label="Response", | |
| lines=15 | |
| ) | |
| ], | |
| allow_flagging="manual", # Enable manual flagging | |
| flagging_options=["Totally Inaccurate", "Somewhat Inaccurate","Almost Accurate","Completely Accurate"], | |
| flagging_callback=hf_writer # Save flagged data to the Hugging Face dataset | |
| ) | |
| demo.queue().launch() | |