willco-afk
commited on
Commit
·
1b73caf
1
Parent(s):
02d0b50
Updated app.py to use Hugging Face InferenceClient correctly
Browse files
app.py
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
client = InferenceClient(
|
| 6 |
|
| 7 |
# Define the prediction function
|
| 8 |
def predict(input_text):
|
| 9 |
try:
|
| 10 |
-
result = client
|
| 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 |
|