Spaces:
Sleeping
Sleeping
import gradio | |
import subprocess | |
examples = [["A qualified alien entered the United States on August 15, 1996. Tell me about their eligibility for Supplemental Security Income (SSI)."], | |
["""Question: Which of the following statements most accurately reflects the eligibility requirements for Supplemental Security Income (SSI) as outlined in the Alien Eligibility Under Welfare Reform? | |
A) To be eligible for SSI, an individual must be a U.S. citizen, with no exceptions for non-citizens. | |
B) SSI eligibility is extended to all individuals residing in the United States, regardless of their citizenship or immigration status. | |
C) To be eligible for SSI, an individual must be either a U.S. citizen or a qualified alien. | |
D) SSI eligibility is determined solely based on financial need, without consideration of citizenship or immigration status."""], | |
["""Explanate the Correct Answer: C | |
Question: Which of the following statements most accurately reflects the eligibility requirements for Supplemental Security Income (SSI) as outlined in the Alien Eligibility Under Welfare Reform? | |
A) To be eligible for SSI, an individual must be a U.S. citizen, with no exceptions for non-citizens. | |
B) SSI eligibility is extended to all individuals residing in the United States, regardless of their citizenship or immigration status. | |
C) To be eligible for SSI, an individual must be either a U.S. citizen or a qualified alien. | |
D) SSI eligibility is determined solely based on financial need, without consideration of citizenship or immigration status."""]] | |
def respond(message, *args, **kwargs): | |
command = [ | |
"python", "-m", "graphrag.query", | |
"--root", "./ragtest", | |
"--method", "global", | |
message | |
] | |
try: | |
result = subprocess.run(command, capture_output=True, text=True, check=True) | |
return result.stdout | |
except subprocess.CalledProcessError as e: | |
return f"Error: {e.stderr}" | |
demo = gr.ChatInterface( | |
respond, | |
examples=examples) | |
if __name__ == "__main__": | |
demo.launch(auth=("tester", "8888p4ss")) |