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( question=question, api_name="/chat" ) end_time = timeit.default_timer() print(result) print("Time Taken: ", end_time-start_time)