languages / app.py
willco-afk
Updated app.py to use Hugging Face InferenceClient correctly
51427c6
raw
history blame contribute delete
481 Bytes
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()