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