| import gradio as gr | |
| from huggingface_hub import InferenceClient | |
| # Create an InferenceClient object (correct method) | |
| client = InferenceClient(repo_id="willco-afk/languages") | |
| # Define the prediction function | |
| def predict(input_text): | |
| # Use the 'predict' method to get the output | |
| result = client.predict(input_text) | |
| return result | |
| # Define the Gradio interface | |
| iface = gr.Interface(fn=predict, inputs="text", outputs="text") | |
| # Launch the interface locally | |
| iface.launch() |