Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,17 +4,14 @@
|
|
| 4 |
import os
|
| 5 |
import time
|
| 6 |
import streamlit as st
|
| 7 |
-
from
|
| 8 |
-
#nno import HfInference from "@huggingface/inference"
|
| 9 |
-
#from huggingface_hub import InferenceClient
|
| 10 |
import random
|
| 11 |
|
| 12 |
# Load the API token from an environment variable
|
| 13 |
api_key = os.getenv("HF_TOKEN")
|
| 14 |
|
| 15 |
# Instantiate the InferenceClient
|
| 16 |
-
|
| 17 |
-
client = new HfInference(api-key)
|
| 18 |
|
| 19 |
# Streamlit app title
|
| 20 |
st.title("LM using HF Inference API (serverless) feature.")
|
|
|
|
| 4 |
import os
|
| 5 |
import time
|
| 6 |
import streamlit as st
|
| 7 |
+
from huggingface_hub import InferenceClient
|
|
|
|
|
|
|
| 8 |
import random
|
| 9 |
|
| 10 |
# Load the API token from an environment variable
|
| 11 |
api_key = os.getenv("HF_TOKEN")
|
| 12 |
|
| 13 |
# Instantiate the InferenceClient
|
| 14 |
+
client = InferenceClient(api_key=api_key)
|
|
|
|
| 15 |
|
| 16 |
# Streamlit app title
|
| 17 |
st.title("LM using HF Inference API (serverless) feature.")
|