willco-afk commited on
Commit
1b73caf
·
1 Parent(s): 02d0b50

Updated app.py to use Hugging Face InferenceClient correctly

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,14 +1,14 @@
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
 
4
- # Initialize the InferenceClient (use the correct model ID)
5
- client = InferenceClient(repo_id="willco-afk/languages")
6
 
7
  # Define the prediction function
8
  def predict(input_text):
9
  try:
10
- result = client.predict(input_text) # Make the prediction
11
- return result
12
  except Exception as e:
13
  return f"Error: {e}"
14
 
 
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
 
4
+ # Use the correct Hugging Face InferenceClient initialization
5
+ client = InferenceClient("willco-afk/languages") # No need for repo_id here
6
 
7
  # Define the prediction function
8
  def predict(input_text):
9
  try:
10
+ result = client(input_text) # Call the model
11
+ return result # Assuming the result is directly usable
12
  except Exception as e:
13
  return f"Error: {e}"
14