from gradio_client import Client | |
import timeit | |
client = Client("Ritesh-hf/rag-api") | |
while True: | |
question = input("Question: ") | |
start_time = timeit.default_timer() | |
result = client.predict( | |
text=question, | |
api_name="/predict" | |
) | |
end_time = timeit.default_timer() | |
print(result) | |
print("Time Taken: ", end_time-start_time) | |